把XML 文件转换为 String 字符串

本是古典 何须时尚 2021-11-02 00:10 854阅读 0赞

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

转载于:https://www.cnblogs.com/xiaoxijin/archive/2009/11/13/1602560.html

发表评论

表情:
评论列表 (有 0 条评论,854人围观)

还没有评论,来说两句吧...

相关阅读