I. Concepts
The process of converting an object into a byte sequence is called serialization.
The process of restoring a byte sequence to an object is called deserialization.
Serialization, also known as serialization, is a mechanism used by the. NET runtime environment to support user-defined streaming. The objective is to make the custom object persistent by storage, or to transmit the object from one place to another.
The. NET Framework provides two serializing methods:
1. Use binaryformatter for serialization;
2. Use soapformatter for serialization;
3. Use xmlserializer for serialization.
The first method provides a simple binary data stream and some additional types of information, while the second method formats the data stream for XML storage. The third method is similar to the second method in XML format storage, it is much simpler than the second XML format (removes the extra information unique to soap ).
AvailableThe [serializable] attribute marks the class as serializable. If the elements of a class do not want to be serialized, 1 or 2 can be used.[Nonserialized] attribute to mark, 2. can be used[Xmlignore.
Http://jingyan.baidu.com/article/a681b0dec765473b184346d9.html