zoukankan      html  css  js  c++  java
  • 提取xml文件显示

    1\

    /*** 提DataSet*/

    2\
    DataSet ds = new DataSet();
       ds.ReadXml(p_strXmlPath);
         
       dataGrid1.DataSource=ds;
       dataGrid1.DataMember="user";

    3\
      FileStream fs = new FileStream(p_strXmlPath,FileMode.Open,FileAccess.Read);
     StreamReader Reader = new StreamReader(fs,System.Text.Encoding.Default);
           
      DataSet ds = new DataSet();
      ds.ReadXml(Reader);
      txtName.Text=ds.GetXml();
      string physicalName =dt.Rows[0]["username"].ToString();
    4\
    XmlDocument xmlD = new XmlDocument();
       xmlD.Load(p_strXmlPath);
      //XmlNamespaceManager xmlns = new XmlNamespaceManager(xmlD.NameTable);   //带 xmlns的处理
        
      XmlNode root = xmlD.SelectSingleNode("myinfo");           //,xmlns;
      MessageBox.Show(root.InnerText);
  • 相关阅读:
    cd的使用
    转换器模式
    装饰模式
    策略模式
    模板方法模式
    工厂模式
    类型信息
    proto编译组件使用
    proto编译引用外部包问题
    Kafka经典三大问:数据有序丢失重复
  • 原文地址:https://www.cnblogs.com/flashicp/p/787213.html
Copyright © 2011-2022 走看看