开发者

how can i unserialize a field whic is in the serializable class

开发者 https://www.devze.com 2023-01-02 07:56 出处:网络
I want to make a class serializable but i dont want make serializable some fileds in this class. how ca开发者_C百科n do that?

I want to make a class serializable but i dont want make serializable some fileds in this class. how ca开发者_C百科n do that?

Thanks for your helps.


If you are using BinaryFormatter to perform the serialization you might add the [NonSerialized] attribute to the field you wish to exclude.

For XmlSerializer look at the [XmlIgnore] attribute.

For DataContractSerializer look at the [IgnoreDataMember] attribute.

0

精彩评论

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