zoukankan      html  css  js  c++  java
  • 本地读取服务器Xml文件及本地读本地的xml

    updateUrl="ServerUrl"(服务器路径)

    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、获取子节点对应的内容
    verson = Convert.ToDouble(node["Verson"].InnerText);
    }

  • 相关阅读:
    在 Spring 中使用 Quartz
    Quartz 快速进阶
    任务调度概述
    Spring Boot 2.x 整合 Mybatis 3.x
    pwd函数实现
    07-图4 哈利·波特的考试 (25 分)
    06-图3 六度空间 (30 分)
    linux中的目录
    Linux中的文件
    06-图2 Saving James Bond
  • 原文地址:https://www.cnblogs.com/wxxf/p/9184258.html
Copyright © 2011-2022 走看看