zoukankan      html  css  js  c++  java
  • 读取xml

    List<path> Report = new List<path>();
    XmlDocument myCha = new XmlDocument();
    try
    {
    myCha.Load(path);
    }
    catch (Exception e)
    {
    if (e != null)
    {
    return Report;
    }
    }
    myCha.Load(path);
    //2.获得根节点
    XmlNode node = myCha.DocumentElement;
    foreach (XmlNode ShowList in node.ChildNodes)
    {
    if (ShowList.Attributes["state"].InnerText.ToString().Equals("1"))
    {
    path report = new path();
    foreach (XmlNode work in ShowList.ChildNodes)
    {

    switch (work.Name)
    {

    case "ip":
    report.ip = work.InnerText;
    break;
    case "ku":
    report.ku= work.InnerText;
    break;
    case "name":
    report.name = work.InnerText;
    break;
    case "passwrod":
    report.passwrod = work.InnerText;
    break;
    }
    }
    Report.Add(report);
    }
    }
    return Report;
    }

  • 相关阅读:
    OpenLDAP与Apache
    OpenLDAP双主
    OpenLDAP主从
    LDAP与禅道
    LDAP与jenkins
    LDAP与Samba
    LDAP与SSH
    LDAP客户端
    LDAP与migrationtools 导入系统账号
    OpenLDAP与phpldapadmin的搭建
  • 原文地址:https://www.cnblogs.com/zchbiji/p/9039911.html
Copyright © 2011-2022 走看看