我有这段代码:
string m_strFilePath = "http://www.google.com/ig/api?weather=12414&hl=it";
XmlDocument myXmlDocument = new XmlDocument();
myXmlDocument.LoadXml(m_strFilePath);
foreach (XmlNode RootNode in myXmlDocument.ChildNodes)
{
}
但是当我尝试执行它时,出现以下错误:
异常细节:System.Xml.XmlException:根级别处的数据无效。第1行,第1个位置。
为什么?我错在哪里了?我该如何在C#上解决这个问题?
也尝试过以下方法:
myXmlDocument.Load(m_strFilePath);
但我收到了以下错误信息:
异常详细信息:System.Xml.XmlException: 给定编码中的字符无效。第1行,第503个位置。