国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
使用XML文件保存應(yīng)用程序配置
private void Load()
{
      XmlDocument doc = new XmlDocument();
      doc.Load("MyXml.xml");
      //read the root node
      XmlNode root = doc.DocumentElement;
      Debug.Assert(root != null, "Setting file is not valid.");
      //read a node under a node with given node name
      XmlNode xn = root.SelectSingleNode("Database");
      Debug.Assert(xn != null, "Setting file is not valid.");
      XmlElement xe = (XmlElement)xn;
      Debug.Assert(xe.Attributes.Count > 0, "Setting file is not valid.");
      //read a attribute with a given attribute name, as <NodeName AttrName1="1" AttrName2="2" />
      string s = xe.GetAttribute("FileName");
      xn = root.SelectSingleNode("IgnoreFields");
     XmlNodeList xnl = xn.ChildNodes;
      foreach (XmlNode xnf in xnl)
      {
        xe = (XmlElement)xnf;
        AList.Add(xe.Attributes[0].Name, xe.Attributes[0].Value);
      }
}

    private void Save()
    {
      XmlDocument doc = new XmlDocument();
      doc.Load("MyXml.xml");
      XmlNode root = doc.DocumentElement;
      Debug.Assert(root != null, "Setting file is not valid.");
      XmlNode xn = root.SelectSingleNode("Database");
      Debug.Assert(xn != null, "Setting file is not valid.");
      XmlElement xe = (XmlElement)xn;
      Debug.Assert(xe.Attributes.Count > 0, "Setting file is not valid.");
      //write a attribute with a given attribute name, as <NodeName AttrName1="1" AttrName2="2" />
      xe.SetAttribute("FileName", "3");
      XmlNode xn = root.SelectSingleNode("Compared");
      Debug.Assert(xn != null, "Setting file is not valid.");
      XmlNode node = doc.CreateNode(XmlNodeType.Element, "Table", null);
      XmlElement xe = (XmlElement)node;
      xe.SetAttribute(StationName, "Y");
      xn.AppendChild(xe);
      doc.Save("MyXml.xml");
    }


本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
C#:XML操作類
C#操作XML小結(jié)
怎樣在C#里對(duì)xml文件進(jìn)行修改,新增,刪除,插入操作?
VB.NET中操作xml文件
C#讀寫xml文件(2)
xmlnode 的value與innertext區(qū)別
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服