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

明輝手游網(wǎng)中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

.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>
  /// 應用程序的主入口點。
  /// </summary>
  [STAThread]
  static void Main(string[] args)
  {
   //
   // TODO: 在此處添加代碼以啟動應用程序
   //
   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>
  /// 應用程序的主入口點。
  /// </summary>
  [STAThread]
  static void Main(string[] args)
  {
   //
   // TODO: 在此處添加代碼以啟動應用程序
   //
   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人片在线观看网址 | 日韩美在线 | 四虎永久在线精品 | 日韩经典中文字幕 | 色综合久久综合网欧美综合网 | 视频在线观看40分钟免费 | 日日日干 | 亚洲五月七月丁香缴情 | 一级女人18毛片免费 | 日本高清午夜色wwwσ | 四虎影视免费观看 | 三级国产精品一区二区 | 日韩午夜片 | 日韩视频免费在线观看 | 三级亚洲 | 日本高清在线一区二区三区 | 亚洲欧美日韩一级特黄在线 | 色久综合网 | 亚洲人成激情在线播放 | 色先锋资源网 | 亚洲欧美在线精品 | 天天天天天天天操 | 亚洲 丝袜 制服 欧美 另类 | 欧美亚洲韩国 | 三级第一页| 日韩视频免费看 | 四虎影院新网址 | 亚洲国产欧美在线 | 天天搞夜夜操 |