• 提取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);
  • 相关阅读:
    PyTorch Tutorials——LEARN THE BASICS
    vscode+remote ssh搭建《dive into deep learning》所需环境
    node.js02 安装Node环境
    node.js01 认识node.js
    二分查找
    暴力枚举
    博客园自定义域名
    斐波那契数列(公兔子掳母兔子问题)
    为什么我要写博客?
    C++基本语法
  • 原文地址:https://www.cnblogs.com/flashicp/p/787213.html
Copyright © 2020-2023  润新知