我有这个代码:
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)
{
}
Run Code Online (Sandbox Code Playgroud)
但是当我尝试执行它时,我收到此错误:
异常详细信息:System.Xml.XmlException:根级别的数据无效.第1行,第1位.
为什么?我哪里错了?我怎样才能在C#上解决这个问题?
还试过:
myXmlDocument.Load(m_strFilePath);
Run Code Online (Sandbox Code Playgroud)
但我得到:
异常详细信息:System.Xml.XmlException:给定编码中的字符无效.第1行,第503位.