等你觉得需要用XML的时候,就有用了,哈哈

解决方案 »

  1.   

    xml在.net中的应用无处不在,就象你说的那几样。
    还有就是在对象的传递中,对象的序列化中,对象就是保存中都起到了很大的作用。
    它可以让你把一个实例对象保存成文本,下次拿来使用,等等。
    不过,对于我们开发来说,.net隐藏了这部份的操作。总的来说,xml在.net中的应用很广泛。
      

  2.   

    http://www.ycrx.com/wytx/tx/38/index.htm
    祝各位程序员中秋快乐。
      

  3.   

    you look:
    http://xml.sz.luohuedu.net/xml/ShowList.asp?id=11
      

  4.   

    哈哈,DataSet始终是以XML格式存储和处理的啊。
    这也是ADO.NET和ADO最本质的区别:)
      

  5.   

    你只要用一下它就知道啦,
    private void WriteXmlToFile(DataSet thisDataSet) {
        if (thisDataSet == null) { return; }
        // Create a file name to write to.
        string filename = "myXmlDoc.xml";
        // Create the FileStream to write with.
        System.IO.FileStream myFileStream = new System.IO.FileStream
           (filename, System.IO.FileMode.Create);
        // Create an XmlTextWriter with the fileStream.
        System.Xml.XmlTextWriter myXmlWriter = 
           new System.Xml.XmlTextWriter(myFileStream, System.Text.Encoding.Unicode);
        // Write to the file with the WriteXml method.
        thisDataSet.WriteXml(myXmlWriter);   
        myXmlWriter.Close();
     }
    private void DemonstrateReadWriteXMLDocumentWithXMLReader(){
       // Create a DataSet with one table and two columns.
       DataSet OriginalDataSet = new DataSet("myDataSet");
        OriginalDataSet.Namespace= "NetFrameWork";
       DataTable myTable = new DataTable("myTable");
       DataColumn c1 = new DataColumn("id", Type.GetType("System.Int32"));
       c1.AutoIncrement= true;
       DataColumn c2 = new DataColumn("item");
       myTable.Columns.Add(c1);
       myTable.Columns.Add(c2);
       OriginalDataSet.Tables.Add(myTable);
       // Add ten rows.
       DataRow newRow;
       for(int i = 0; i < 10; i++){
          newRow = myTable.NewRow();
          newRow["item"]= "item " + i;
          myTable.Rows.Add(newRow);
       }
       OriginalDataSet.AcceptChanges();
       // Print out values of each table in the DataSet using the 
       // function defined below.
       PrintValues(OriginalDataSet, "Original DataSet");
       // Write the XML schema and data to file with FileStream.
       string xmlFilename = "myXmlDocument.xml";
       // Create FileStream    
       System.IO.FileStream fsWriteXml = new System.IO.FileStream
          (xmlFilename, System.IO.FileMode.Create);
       // Create an XmlTextWriter to write the file.
       System.Xml.XmlTextWriter xmlWriter = new System.Xml.XmlTextWriter
          (fsWriteXml, System.Text.Encoding.Unicode);
       // Use WriteXml to write the document.
       OriginalDataSet.WriteXml(xmlWriter);
       // Close the FileStream.
       fsWriteXml.Close();
          
       // Dispose of the original DataSet.
       OriginalDataSet.Dispose();
       // Create a new DataSet.
       DataSet newDataSet = new DataSet("New DataSet");
          
       // Read the XML document back in. 
       // Create new FileStream to read schema with.
       System.IO.FileStream fsReadXml = new System.IO.FileStream
          (xmlFilename, System.IO.FileMode.Open);
       // Create an XmlTextReader to read the file.
       System.Xml.XmlTextReader myXmlReader = 
          new System.Xml.XmlTextReader(fsReadXml);
       // Read the XML document into the DataSet.
       newDataSet.ReadXml(myXmlReader);
       // Close the XmlTextReader
       myXmlReader.Close();   // Print out values of each table in the DataSet using the 
       // function defined below.
       PrintValues(newDataSet,"New DataSet");
    }private void PrintValues(DataSet ds, string label){
       Console.WriteLine("\n" + label);
       foreach(DataTable t in ds.Tables){
          Console.WriteLine("TableName: " + t.TableName);
          foreach(DataRow r in t.Rows){
             foreach(DataColumn c in t.Columns){
                Console.Write("\t " + r[c] );
             }
             Console.WriteLine();
          }
       }
    }
      

  6.   

    to  snof(雪狼) :我不知你让我看的用意,你上面的读、写xml的代码直接用DataSet.ReadXml()和DataSet.WriteXml()不就Ok了吗,你为何要转那么多弯?
      

  7.   

    xml在.net中也用于写注释, 函数名称说明, 参数名称说明都可以在函数名上打三个/就自动出现你只要会填写就行了, 编译后, 调用函数时, 会自动出现函数的提示信息
    .net中应用程序调用web service, 都是用xml进行交流
      

  8.   

    http://expert.csdn.net/Expert/topic/2255/2255965.xml?temp=.1459619
    帮up就行。在这次大会上,VS.Net介绍中的ppt图中有一张就是介绍VS开发应用的,背影全是xml这三个字母。主要应用还有 mobile , 终端 , 与其它设备之间的通信。
    还有它的跨平台也要用到XML
      

  9.   

    xml在.net中的应用无处不在,就象你说的那几样。
    还有就是在对象的传递中,对象的序列化中,对象就是保存中都起到了很大的作用。
    它可以让你把一个实例对象保存成文本,下次拿来使用,等等。
    不过,对于我们开发来说,.net隐藏了这部份的操作。总的来说,xml在.net中的应用很广泛。
      

  10.   

    说来说去,大概都是隐式的用法,很少有显示的用法。
    公司让我在C#中的xml的使用,我想来想去,好象都封装过,没有必要知道如何用。不知是否正确。