Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 使用XPath.XPathDocument()函数时出错_Vb.net_Url_Xpathdocument - Fatal编程技术网

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

Vb.net 使用XPath.XPathDocument()函数时出错,vb.net,url,xpathdocument,Vb.net,Url,Xpathdocument,我正在ASP.NET/VB.NET项目中使用以下代码: Dim sourceFile as String = "http://xml.weather.yahoo.com/forecastrss?p=94704" Dim xPath As New XPath.XPathDocument(sourceFile) 第二行给出了错误: “无法连接到远程服务器” 当我在web浏览器中浏览url(sourceFile)时,它会精细地打开RSS提要页面。 如何删除此错误?如果您的应用程序无法连接到远程服务器

我正在ASP.NET/VB.NET项目中使用以下代码:

Dim sourceFile as String = "http://xml.weather.yahoo.com/forecastrss?p=94704"
Dim xPath As New XPath.XPathDocument(sourceFile)
第二行给出了错误: “无法连接到远程服务器”

当我在web浏览器中浏览url(sourceFile)时,它会精细地打开RSS提要页面。
如何删除此错误?

如果您的应用程序
无法连接到远程服务器
,那么这里没有关于
XPath.XPathDocument的内容

使用其他方法检查连接,例如
WebClient