【发布时间】:2016-03-26 17:26:06
【问题描述】:
基本上我正在尝试解析xml from this
但是我收到{“远程服务器返回错误:(463)。”}(System.Net.WebException)错误发生在string xml = webClient2.DownloadString(address);
这是我的完整代码
Task.Run((Action)(() =>
{
XmlDocument xmlDocument = new XmlDocument();
using (WebClient webClient1 = new WebClient())
{
WebClient webClient2 = webClient1;
Uri address = new Uri("https://habbo.com/gamedata/furnidata_xml/1");
string xml = webClient2.DownloadString(address);
xmlDocument.LoadXml(xml);
}
foreach (XmlNode xmlNode1 in xmlDocument.GetElementsByTagName("furnitype"))
{
string nr1 = "[" + xmlNode1.Attributes["id"].Value + "]";
string nr2 = " : " + xmlNode1.Attributes["classname"].InnerText;
foreach (XmlNode xmlNode2 in xmlNode1)
{
XmlNode childNode = xmlNode2;
if (childNode.Name == "name")
{
this.FurniCB.Invoke((Action)(() => this.FurniCB.Items.Add((object)(nr1 + nr2 + " : " + childNode.InnerText))));
this.FurniDataList.Add(nr1 + nr2 + " : " + childNode.InnerText);
}
}
}
}));
提前致谢
【问题讨论】: