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

XmlÐòÁл¯ºÍ·´ÐòÁл¯

¾­³£¼ûXMLÐòÁл¯µÄÎÄÕ£¬¶Ô¸ÃÐòÁл¯·½Ê½²¢²»ÊÇÌ«ÏþµÃ£¬¿´ÁËMSDNºÍһЩ×ÊÁϺóÓÐÁË´óÖµÄÁ˽⣬´óµÀÀí½²²»³öÀ´£¬ÉÏ ´úÂëÏÈ£º
·½Ê½Ò» ͨ¹ýXmlSerializeÖ±½ÓÐòÁл¯£º
Class BeSerialized
{
//ij×Ö¶Î
public int someFiled; 
//¹«¹²ÀàµÄÒ»¸ö¿ÉÐòÁл¯µÄÊôÐÔ
private bool serialme;
public bool SerialMe
{
     get { return serialme; }
     set { serialme = value; }
}
 
}
class process
{
public void Main()
{
SerialIt();
DeSerialIt();
}
SerialIt()
{
BeSerialized bs=new BeSerialized();
bs.someFiled=;
bs.SerialMe=;
XmlSerialize xs=new XmlSerialize(typeof(BeSerialized));
StreamWriter sw=
xs.Serialze(sw,bs);
}
DeSerialIt()
{
XmlSerialze xs=new XmlSerialize(typeof(BeSerialized));
StreamReader sr
BeSerialized bs=(BeSerialized)xs.DeSerialize(sr);
}
}
·½Ê½¶þ ÊÖ¶¯ÔÚÒªÐòÁл¯µÄÀàÉèÖÃÊôÐÔÀàÐÍ
public class Student
{
    private int id;
    [xmlAttribute]
    public int ID   //ÐòÁл¯Ê±×÷ΪStudent½ÚµãµÄÊôÐÔ¶ø²»ÊÇĬÈϵÄ×Ó½Úµã
    {
        get { return id; }
        set { id = value; }
    }
    private string name;
   [XmlElement("sname")]
    public string Name  //½ÚµãÃû³ÆΪsname¶ø²»ÊÇĬÈϵÄName
    {
        get { return name; }
        set { name = value; }
    }
    private int age;
    [XmlIgnore]
    public int Age      //ºöÂÔ¸ÃÊôÐÔ£¬²»´æÈëXMLÎļþ
    {
        get { return age; }
        set { age = value; }
    }
    internal int score = 88;
    public override string ToString()
    {


Ïà¹ØÎĵµ£º

ÔÚ.NETÌåϵ½á¹¹ÖУ¬XMLÊǸ÷Ó¦ÓÃÖ®¼äÎÞ·ì½ÓºÏµÄ¹Ø¼ü

  ¶ÔÓÚ.NETµ½µ×ÊÇʲôÕâ¸öÎÊÌ⣬ÓÐן÷ÖÖ¸÷ÑùµÄ˵·¨¡£µ«µ±Ê±×÷ΪÊ×ϯִÐйٵı«¶ûĬӦ¸Ã×îÄÜ´ú±í΢Èí¹«Ë¾µÄ¹Û
µã£¬Ëû˵£º“Microsoft.NET ´ú±íÁËÒ»¸ö¼¯ºÏ¡¢Ò»¸ö»·¾³¡¢Ò»¸ö¿ÉÒÔ×÷Ϊƽ̨֧³ÖÏÂÒ»´úInternetµÄ¿É±à³Ì½á¹¹¡£”È·
ʵ£¬Õâ¾ä»°»ù±¾Éϼòµ¥¶óÒªµØ±íÊöÁË.NETµÄÍâÌØÐÔ¡£
  .NETÊ×ÏÈÊÇÒ»¸ö»·¾³¡ ......

Flash as3 ×Ô¶¨ÒåReadXMLÀà¶ÁÈ¡xml ¡¾Ô­´´¡¿

¼òµ¥µÄÀ࣬¼ò»¯×Ô¼º¶ÁÈ¡xmlµÄ¹ý³Ì
ReadXML.as
package
{
import flash.display.Sprite;
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.Event;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.system.System;
import flash.events.EventDis ......

C++ ²Ù×÷XMLµÄÍêÕûÀý×Ó——MSXMLƪ

д±¾ÎĵÄÄ¿µÄÊÇΪÁË·½±ã´ó¼ÒÁ˽âC++ MSXML²Ù×÷·½·¨¡£
µ±È»£¬C++ÖжÔMSXMLµÄµ÷ÓÃÓжàÖÖ£¬±¾ÎIJÉÓõķ½·¨ÊÇÍêÈ«²ÎÕÕMSXML SDKÌṩµÄÎĵµ½øÐвÙ×÷¡£
Èç¹ûÓÐʲô´íÎ󣬻¶Ó­Ö¸Õý¡£
´úÂë¿ò¼ÜÊÇ»ùÓÚvs2008 MFC ¶Ô»°¿ò³ÌÐò£¨UNICODE£©¡£¶Ô»°¿ò³ÌÐòÐèÒª¶ÁÕß×Ô¼º´´½¨¡£
#include <msxml6.h>
#include <comutil.h>
# ......

DataSetÓëxmlÎļþµÄ»¥Ïàת»»


http://www.cnblogs.com/long2006sky/articles/1258731.html
DataSetת»»ÎªxmlÎļþ
//½«DataSetת»»ÎªxmlÎļþ
        private static void ConvertDataSetToXMLFile(DataSet xmlDS, string xmlFile)
        {
    &n ......

XMLTextReader¶ÔXMLÎļþµÄ¶ÁÈ¡

using System;
using System.Xml;
namespace ReadXMLfromFile
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
static void Main(string[] args)
{
XmlTextReader reader = new XmlTextReader ("books.xml");
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ