难道"默认"序列化在C#序列化静态字段? [英] Does "default" serialization in C# serialize static fields?

查看:195
本文介绍了难道"默认"序列化在C#序列化静态字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是默认我的意思是只使用类上的[Serializable]属性。我想说的是,没有,静态字段不会被序列化,但我不能完全确定。

By "default" I mean just using the [Serializable] attribute on the class. I want to say that no, static fields would not be serialized, but I'm not exactly sure.

推荐答案

没有;静态字段不是序列化

No; static fields are not serialized.

净序列化序列化的实例;静态字段不属于一个实例。

.Net serialization serializes instances; static fields do not belong to an instance.

这篇关于难道"默认"序列化在C#序列化静态字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆