惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
Know Your Adversary
Know Your Adversary
P
Palo Alto Networks Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
L
LINUX DO - 热门话题
P
Proofpoint News Feed
P
Privacy & Cybersecurity Law Blog
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
Cisco Talos Blog
Cisco Talos Blog
AI
AI
L
LINUX DO - 最新话题
H
Heimdal Security Blog
Hacker News: Ask HN
Hacker News: Ask HN
Webroot Blog
Webroot Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The GitHub Blog
The GitHub Blog
I
Intezer
Blog — PlanetScale
Blog — PlanetScale
有赞技术团队
有赞技术团队
S
Securelist
博客园_首页
IT之家
IT之家
Schneier on Security
Schneier on Security
博客园 - 叶小钗
罗磊的独立博客
WordPress大学
WordPress大学
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
阮一峰的网络日志
阮一峰的网络日志
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
W
WeLiveSecurity
The Register - Security
The Register - Security
D
DataBreaches.Net
S
Security @ Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
Recorded Future
Recorded Future
NISL@THU
NISL@THU
N
News and Events Feed by Topic
T
Tailwind CSS Blog
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
T
Tor Project blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com

博客园 - WebQ

工作流软件升级完成 !!!!!!求救:.Net调用迅雷的问题!!!!! 行政审批工作流系统寻求合作 地铁上的遭遇 开始升级我的工作流系统 IE7中如何子窗口只在关闭时刷新opener 英文标点符号翻译大全 One Bug of WatiN? - WebQ How to pass a input parameter in Script task of SSIS Handle alert dialog with WatiN Working overtime The Tongsha ferry (通沙汽渡) over Changjiang river 实现COM组件访问.Net组件的方法 a article about Polymorphism ASP.NET 页面对象模型 What is WSDL? 自定义控件中UserControl(用户控件)和CustomControl(自定义控件)的区别 常见的手机英语 Callback with event and delegate over .net remoting
Object Serailization
WebQ · 2006-07-09 · via 博客园 - WebQ

1、默认情况下,类型中由 SerializableAttribute 标记的所有公共和私有字段都会进行序列化,除非该类型实现 ISerializable 接口来重写序列化进程。

2、默认的序列化进程会排除用 NonSerializedAttribute 属性标记的字段。如果可序列化类型的字段包含指针、句柄或其他某些针对于特定环境的数据结构,并且不能在不同的环境中以有意义的方式重建,则最好将 NonSerializedAttribute 属性应用于该字段。
3、我们可以实现ISerializable接口来自定义串行化行为。这个接口只有一个方法GetObjectData。这个方法用于将对类对象进行序列化所需的数据填进SerializationInfo对象。你使用的格式化器(比如BinaryFormatter)将构造SerializationInfo对象,然后在序列化时调用GetObjectData。因此,你需要实现GetObjectData,让它添加你从类中选择的值,并且映射到你选择的字符串名。注意,如果类的父类也实现ISerializable,那么应该调用GetObjectData的父类实现。