乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      c#寫XML

       素行 2007-01-19
      參考
      xmldoc = new XmlDocument ( ) ;
      //加入XML的聲明段落,<?xml version="1.0" encoding="gb2312"?>
      XmlDeclaration xmldecl;
      xmldecl = xmldoc.CreateXmlDeclaration("1.0","gb2312",null);
      xmldoc.AppendChild ( xmldecl);

      //加入一個根元素
      xmlelem = xmldoc.CreateElement ( "" , "Employees" , "" ) ;
      xmldoc.AppendChild ( xmlelem ) ;
      //加入另外一個元素
      for(int i=1;i<3;i++)
      {

      XmlNode root=xmldoc.SelectSingleNode("Employees");//查找<Employees>
      XmlElement xe1=xmldoc.CreateElement("Node");//創(chuàng)建一個<Node>節(jié)點(diǎn)
      xe1.SetAttribute("genre","李贊紅");//設(shè)置該節(jié)點(diǎn)genre屬性
      xe1.SetAttribute("ISBN","2-3631-4");//設(shè)置該節(jié)點(diǎn)ISBN屬性

      XmlElement xesub1=xmldoc.CreateElement("title");
      xesub1.InnerText="CS從入門到精通";//設(shè)置文本節(jié)點(diǎn)
      xe1.AppendChild(xesub1);//添加到<Node>節(jié)點(diǎn)中
      XmlElement xesub2=xmldoc.CreateElement("author");
      xesub2.InnerText="候捷";
      xe1.AppendChild(xesub2);
      XmlElement xesub3=xmldoc.CreateElement("price");
      xesub3.InnerText="58.3";
      xe1.AppendChild(xesub3);

      root.AppendChild(xe1);//添加到<Employees>節(jié)點(diǎn)中
      }
      //保存創(chuàng)建好的XML文檔
      xmldoc.Save ( Server.MapPath("data.xml") ) ;

        本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多