Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

C#дXMLµÄ¼òµ¥Àý×Ó

Õâ¸öÀý×ÓÒª°Ñbookstore.xmlÎļþÔö¼ÓÒ»Ìõbook¼Ç¼
1 bookstore.xml
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
  <book genre="love" ISBN="1234123">
    <title>who am i </title>
    <author>who</author>
    <price>999</price>
  </book>
</bookstore>
2 bookstore.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
namespace toxml
{
    public class ToXml
    {
        public static void Main(string[] args)
        {
            //ʵÀý»¯Ò»¸öXmlDocument¶ÔÏó
            XmlDocument xmlDoc = new XmlDocument();
            //ʵÀý¶ÔÏó¶ÁȡҪдÈëµÄXMLÎļþ
            xmlDoc.Load("bookstore.xml");
            //²éÕÒ<bookstore>
            XmlNode root = xmlDoc.SelectSingleNode("bookstore");
            //´´½¨Ò»¸ö<book>½Úµã
            XmlElement xe1 = xmlDoc.CreateElement("book");
            //ÉèÖøýڵãgenreÊôÐÔ
            xe1.SetAttribute("leixing", "music");
            //ÉèÖøýڵãISBNÊôÐÔ   
            xe1.SetAttribute("ISBN", "56756");
         


Ïà¹ØÎĵµ£º

c#¼òµ¥²Ù×÷×¢²á±í

Ò»¡¢Ê×ÏÈÏÈÌí¼ÓÒýÓà   using Microsoft.Win32;     
//ÒòΪ²Ù×÷×¢²á±íµÄÁ½¸öÀàRegistryKeyºÍRegistry¶¼°üº¬ÔÚ´ËÒýÓÃÖУ»
 
¶þ¡¢±àд´úÂ뿪ʼ²Ù×÷×¢²á±í
1¡¢ #region      ÏÞÖÆÈí¼þµÄʹÓôÎÊý
        pri ......

flexͨ¹ýHTTPService×é¼þ¶ÁÈ¡¸´ÔӽṹµÄxmlÎļþ

    ŪÁËÁ½Ì죬ÖÕÓڰѸ´ÔÓµÄxmlÎļþµÄÊý¾Ý¸ù¾Ý×Ô¼ºµÄÒªÇó¶Á³öÀ´£¬ÏÔʾÔÚÒ³ÃæÉÏÁË¡£flexͨ¹ýHTTPService×é¼þ·¢ËÍÇëÇ󣬶ÁÈ¡xmlÎļþÖÐÊý¾Ý£¬ÓÃxmllistcollection´æ´¢xmlÖÐijһ²¿·ÖÊý¾Ý£¬²¢°ó¶¨ÔÚgridview¿Ø¼þÉÏ¡£
    xml£¬xmllist£¬xmllistcollectionÖÐÖ»ÓÐxmllistcollection¾ßÓÐÐ޸ĸüÐÂÊý¾ ......

ģʽºÍxmlѧϰ£¨2£©

Ò»£ºÉè¼ÆÄ£Ê½²¿·Ö
״̬ģʽ£¨state£©
״̬ģʽÀàËÆÓÚÒ»ÖÖ¼òµ¥µÄ¹¤×÷Á÷£¬ÓÃÀ´°Ñ´óÁ¿µÄÅжϷÖÖ§½øÐвð·Ö£¬¸øÃ¿Ò»ÖÖÅжÏÔö¼ÓÒ»¸ö״̬£¬Èç¹û²»Âú×ã¸ÃÅжϿÉÒÔ½øÐÐ״̬ת»»£¬ÖªµÀÓöµ½Âú×ãÌõ¼þΪֹ
ÕâÑù×öµÄºÃ´¦¾ÍÊÇ£¬µ±ÐèÒªÔö¼ÓÅжϵÄʱºò£¬²»ÐèÒª¸Ä±äÒѾ­´æÔڵĴúÂë¡£Ö»ÐèÒªÔö¼ÓÅжϵÄÀ࣬ԭʼÅжÏÀàÖÐÔö¼ÓеÄ״̬ת»»¡£
Ê ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ