本地读取服务器Xml文件及本地读本地的xml
?
updateUrl="ServerUrl"(服務(wù)器路徑)
WebClient wc = new WebClient();
Stream stream = wc.OpenRead(updateUrl);
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(stream);
XmlNode list = xmlDoc.SelectSingleNode("Update");
foreach (XmlNode node in list)
{
if (node.Name == "Soft" && node.Attributes["Name"].Value.ToLower() == SoftName.ToLower())
{
foreach (XmlNode xml in node)
{
if (xml.Name == "Verson")
newVerson = xml.InnerText;//拿到最新版本號
else
download = xml.InnerText;//拿到要更新的文件
}
}
}
//Version ver = new Version(newVerson);
//Version verson = Assembly.LoadFrom(loadFile).GetName().Version;
Double versonSer = Convert.ToDouble(newVerson);
//獲取本地版本號..
xmlDoc.Load("Update.xml");
XmlElement xmlRoot = xmlDoc.DocumentElement;
Double verson = 0;
foreach (XmlNode node in xmlRoot.ChildNodes)
{
//5、獲取子節(jié)點(diǎn)對應(yīng)的內(nèi)容
verson = Convert.ToDouble(node["Verson"].InnerText);
}
轉(zhuǎn)載于:https://www.cnblogs.com/wxxf/p/9184258.html
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎總結(jié)
以上是生活随笔為你收集整理的本地读取服务器Xml文件及本地读本地的xml的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 梦到菠菜是胎梦吗
- 下一篇: 梦到自己在捡柴是什么意思