序列化是指将对象实例的状态存储到存储媒体的过程。在此过程中,先将对象的公共字段和私有字段以及类的名称(包括类所在的程序集)转换为字节流,然后再把字节流写入数据流。在随后对对象进行反序列化时,将创建出与原对象完全相同的副本。
[Serializable] 在C#中的作用 NET 对象序列化(一)using System;
[Serializable] 在C#中的作用 NET 对象序列化(一)
using System.Collections.Generic;
[Serializable] 在C#中的作用 NET 对象序列化(一)
using System.Linq;
[Serializable] 在C#中的作用 NET 对象序列化(一)
using System.Text;
[Serializable] 在C#中的作用 NET 对象序列化(一)
using System.IO;
[Serializable] 在C#中的作用 NET 对象序列化(一)
using System.Runtime.Serialization;
[Serializable] 在C#中的作用 NET 对象序列化(一)
using System.Runtime.Serialization.Formatters.Soap;
[Serializable] 在C#中的作用 NET 对象序列化(一)
using System.Runtime.Serialization.Formatters.Binary;
[Serializable] 在C#中的作用 NET 对象序列化(一)
[Serializable] 在C#中的作用 NET 对象序列化(一)
namespace ConsoleApp


text.xml内容 

<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<a1:TestSimpleObject id="ref-1" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/ConsoleApp/ConsoleApp%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
<_x003C_Name_x003E_k__BackingField id="ref-3">abeen</_x003C_Name_x003E_k__BackingField>
<_x003C_Age_x003E_k__BackingField>26</_x003C_Age_x003E_k__BackingField>
</a1:TestSimpleObject>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

,Name,Age));
        }
    }
}

相关文章: