把XML 文件转换为 String 字符串
using System.Xml;
//———————————————
string xmlFile = Server.MapPath(@”files.xml”);
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(xmlFile);
string xmlStr = xmlDoc.OuterXml;
TextBox1.Text = xmlStr;
//—————————————
1. Serialize and deserialize objects as Xml using generic types in C# 2.0
http://geekswithblogs.net/paulwhitblog/archive/2007/07/20/114076.aspx
2.XML Serialization with C#
http://www.willasrari.com/blog/xml-serialization-with-c/000231.aspx
3.Serializing .NET Objects Into XML – How to Retrieve XML Schema From an Interface
http://blog.bodurov.com/XML-Schema-From-dot-NET-Interface
转载于//www.cnblogs.com/xiaoxijin/archive/2009/11/13/1602560.html
还没有评论,来说两句吧...