六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網(wǎng)中心:是一個(gè)免費(fèi)提供流行視頻軟件教程、在線學(xué)習(xí)分享的學(xué)習(xí)平臺(tái)!

.Net FrameWork SDK文檔的例子演示

[摘要]XmlDocument.CreateAttribute 效果演示using System;using System.IO;using System.Xml; namespace CreateAttribute /// <summary> /// Class1 的摘要說明。 /// &l...
XmlDocument.CreateAttribute 效果演示

using System;
using System.IO;
using System.Xml;

namespace CreateAttribute
{
 /// <summary>
 /// Class1 的摘要說明。
 /// </summary>
 class Class1
 {
  /// <summary>
  /// 應(yīng)用程序的主入口點(diǎn)。
  /// </summary>
  [STAThread]
  static void Main(string[] args)
  {
   //
   // TODO: 在此處添加代碼以啟動(dòng)應(yīng)用程序
   //
   XmlDocument doc = new XmlDocument();
   doc.LoadXml("<book genre='novel' ISBN='1-861001-57-5'>" +
    "<title>Pride And Prejudice</title>" +
    "</book>");

   //Create an attribute.
   XmlAttribute attr = doc.CreateAttribute("publisher");
   attr.Value = "WorldWide Publishing";
         
   //Add the new node to the document.
   doc.DocumentElement.SetAttributeNode(attr);
       
   Console.WriteLine("Display the modified XML...");       
   doc.Save(Console.Out);
  }
 }
}


效果如下:
Display the modified XML...
<?xml version="1.0" encoding="gb2312"?>
<book genre="novel" ISBN="1-861001-57-5" publisher="WorldWide Publishing">
  <title>Pride And Prejudice</title>
</book>Press any key to continue

XmlDocument.CreateNode 方法效果演示

using System;
using System.Xml;

namespace CreateNode
{
 /// <summary>
 /// Class1 的摘要說明。
 /// </summary>
 class Class1
 {
  /// <summary>
  /// 應(yīng)用程序的主入口點(diǎn)。
  /// </summary>
  [STAThread]
  static void Main(string[] args)
  {
   //
   // TODO: 在此處添加代碼以啟動(dòng)應(yīng)用程序
   //
   XmlDocument doc = new XmlDocument();
   doc.LoadXml("<book>" +
    "  <title>Oberon's Legacy</title>" +
    "  <price>5.95</price>" +
    "</book>");
 
   // Create a new element node.
   XmlNode newElem;
   newElem = doc.CreateNode(XmlNodeType.Element, "pages", ""); 
   newElem.InnerText = "290";
    
   Console.WriteLine("Add the new element to the document...");
   XmlElement root = doc.DocumentElement;
   root.AppendChild(newElem);
    
   Console.WriteLine("Display the modified XML document...");
   Console.WriteLine(doc.OuterXml);
  }
 }
}

效果:
Add the new element to the document...
Display the modified XML document...
<book><title>Oberon's Legacy</title><price>5.95</price><pages>290</pages></book>

Press any key to continue





主站蜘蛛池模板: 最新影院 | 使劲儿操| 日本视频在线免费播放 | 亚洲精品成人a | 无人码一区二区三区视频 | 日韩 亚洲 翔田千里 在线 | 日日操视频 | 中文字幕波多野结衣免费视频 | 欧美性操 | 综合久久久久久 | 中文字幕日韩精品亚洲七区 | 日韩激情视频在线 | 青草久草| 中文字幕激情视频 | 四虎影院海外永久 | 天天干夜啪 | 日本捆绑调教hd在线观看 | 伊人免费在线观看高清版 | 特黄色片 | 欧美亚洲国产激情一区二区 | 日韩黄色录像 | 四虎必出精品亚洲高清 | 日本在线看免费 | 日韩欧美国产另类 | 伊人手机视频 | 日本黄网站高清色大全 | 日本乱人伦片中文字幕三区 | 婷婷丁香六月天 | 色先锋资源网 | 青青热久免费精品视频网站 | 午夜快播| 天天想天天干 | 色吧综合网 | 日本精品久久久久久久久免费 | 性刺激欧美三级在线现看中文 | 伊人官网| 亚洲影视大全 | 污污在线观看视频 | 色网站在线看 | 亚洲国产欧美在线成人aaaa | 亚洲色大成网站www 亚洲三级中文字幕 |