开发者

Serialization in asp.net

开发者 https://www.devze.com 2023-01-12 20:07 出处:网络
Is it true that every object th开发者_JAVA百科at use .ToString() in asp.net can be called as serialization ?

Is it true that every object th开发者_JAVA百科at use .ToString() in asp.net can be called as serialization ? If yes then why and if no then why not..

Thanks


No, this is not true. If an object overrides ToString it means that you can print its values but the process is not necessary reversible. Serialization is a reversible process when an object instance is converted to some format. Deserialization is the inverse process when an object instance is created from some format. In .NET common formats for serializing objects are XML and binary. For binary serialization types need to be decorated with the [Serializable] attribute.


All objects inherit tostring() from Object, but not all objects are serializable. Serialization does not involve the tostring method.

0

精彩评论

暂无评论...
验证码 换一张
取 消