MZ-NetBlog主题

C# Xml序列化与反序列化
C#基础

C# Xml序列化与反序列化

2835 0

using System.IO;using System.Xml.Serialization;private void TestXmlSerialize(){//原创来自 http://www.luofenming.com/show.aspx?id=ART2018112100001转载请保留此地址string ConfigPath = AppDomain.CurrentDomain.BaseDirectory + "JH.xml";string xmlData …

C#序列化与反序列化源码实例
C#基础

C#序列化与反序列化源码实例

1673 0

[Serializable]public class ContentStr{public string content { get; set; }/// <summary> 序列化到"TreeViewTexted.dat"文件 </summary>public void Serialize(string Paht){try{using (Stream stream = new FileStream(Paht, FileMode.Create, Fi…