0

我在我的 ASP.NET/VB.NET 项目中使用此代码:

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

第二行给出错误:“无法连接到远程服务器”

当我在网络浏览器中浏览 url (sourceFile) 时,它会很好地打开 RSS 提要页面。如何消除此错误?

4

1 回答 1

0

XPath.XPathDocument如果您的应用程序是unable to connect to the remote server.

使用另一种方法检查连接,例如WebClient

于 2011-01-11T12:00:16.403 回答