为什么XmlDocument.LoadXml抛出System.Net.WebException?

前端之家收集整理的这篇文章主要介绍了为什么XmlDocument.LoadXml抛出System.Net.WebException?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
为什么System.Xml.XmlDocument.LoadXml方法抛出System.Net.WebException?

这真的是令人难以置信的疯狂,如果MSDN是对的,LoadXml应该最多给我一个System.Xml.XmlException.

但我有奇怪的例外:

The underlying connection was closed: The connection was closed unexpectedly.

Dim document As New XmlDocument
document.LoadXml("<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Transitional//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd""><x></x>")
MsgBox(document.LastChild.Name)

造成异常的是什么?

猜你在找的VB相关文章