为什么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)
到底是什么导致了异常?