简体   繁体   English

使用XPath.XPathDocument()函数时出错

[英]Error when I use XPath.XPathDocument() function

I'm using this code in my ASP.NET/VB.NET project: 我在我的ASP.NET/VB.NET项目中使用以下代码:

Dim sourceFile as String = "http://xml.weather.yahoo.com/forecastrss?p=94704"
Dim xPath As New XPath.XPathDocument(sourceFile)

and the second line gives the error: "Unable to connect to the remote server" 并且第二行给出错误:“无法连接到远程服务器”

When I browse the url (sourceFile) in web browser, it opens the RSS feeds page finely. 当我在网络浏览器中浏览URL(sourceFile)时,它会很好地打开RSS feed页面。 How can I remove this error? 如何清除此错误?

Here is nothing about XPath.XPathDocument if your application is unable to connect to the remote server . 如果您的应用程序unable to connect to the remote server则与XPath.XPathDocument无关。

Check the connection using another method, eg WebClient . 使用其他方法(例如WebClient检查连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM