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

推荐订阅源

L
Lohrmann on Cybersecurity
S
Secure Thoughts
I
Intezer
Forbes - Security
Forbes - Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
H
Help Net Security
IT之家
IT之家
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
宝玉的分享
宝玉的分享
S
Securelist
T
The Exploit Database - CXSecurity.com
博客园 - 叶小钗
Security Latest
Security Latest
The Cloudflare Blog
Jina AI
Jina AI
T
Tenable Blog
J
Java Code Geeks
G
GRAHAM CLULEY
C
CERT Recently Published Vulnerability Notes
SecWiki News
SecWiki News
AI
AI
博客园 - 聂微东
S
Schneier on Security
博客园_首页
爱范儿
爱范儿
有赞技术团队
有赞技术团队
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 【当耐特】
T
Threatpost
Security Archives - TechRepublic
Security Archives - TechRepublic
Help Net Security
Help Net Security
酷 壳 – CoolShell
酷 壳 – CoolShell
Recent Announcements
Recent Announcements
W
WeLiveSecurity
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
月光博客
月光博客
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
T
Threat Research - Cisco Blogs
S
Security Affairs
T
Tor Project blog
T
Tailwind CSS Blog
N
News | PayPal Newsroom
C
CXSECURITY Database RSS Feed - CXSecurity.com
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
The Register - Security
The Register - Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security

博客园 - 技术已荒废

c000021a错误 使用托管代码进行 XML Web services 编程 让你的窗口更迷人 动态链接库学习 Delphi调用WebServices(C#)代码 Delphi归来 c#2.0中新增的两个压缩类(转贴) asp.net常用代码 好久不见了 XML(一) 了解WML 接口学习(一) Flash与JavaScript信息交互 字符串替换 在vs2005中如何将Turboc2.0嵌套在网页中? frameset 使用心得 Delphi调用webservice心得 delphi小技巧 delphi流操作心得
序列化使用心得
技术已荒废 · 2006-11-07 · via 博客园 - 技术已荒废

序列化分类:

(一)浅层序列化
XmlSerialization,是将对象的公共字段和属性或者方法的参数和返回值转换(序列化)为符合特定XML 架构定义语言(XSD) 文档的XML 流。
(二)深层序列化
BinaryFormatter和SoapFormatter,是将对象的公共字段和私有字段以及类的名称(包括包含该类的程序集)都被转换为字节流,然后写入数据流。

序列化图解:

浅层序列化:拷贝属性值到一个字节流的过程

深层序列化:拷贝对象数据到一个字节流的过程

示例代码:
ds.RemotingFormat 
= SerializationFormat.Binary;//序列化为二进制
BinaryFormatter bf = new BinaryFormatter ();
StreamWriter swDat 
= new StreamWriter ("output_dataset.dat");
bf.Serialize(swDat.BaseStream, ds);
swDat.Close();