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

推荐订阅源

V2EX - 技术
V2EX - 技术
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Latest news
Latest news
T
The Exploit Database - CXSecurity.com
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
L
Lohrmann on Cybersecurity
aimingoo的专栏
aimingoo的专栏
B
Blog
T
Threat Research - Cisco Blogs
罗磊的独立博客
Application and Cybersecurity Blog
Application and Cybersecurity Blog
P
Proofpoint News Feed
P
Palo Alto Networks Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
博客园 - 司徒正美
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
T
Tor Project blog
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
Martin Fowler
Martin Fowler
酷 壳 – CoolShell
酷 壳 – CoolShell
Recorded Future
Recorded Future
D
DataBreaches.Net
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
IT之家
IT之家
B
Blog RSS Feed
Scott Helme
Scott Helme
P
Proofpoint News Feed
V
Vulnerabilities – Threatpost
A
Arctic Wolf
Help Net Security
Help Net Security
L
LINUX DO - 最新话题
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Vercel News
Vercel News
AWS News Blog
AWS News Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Schneier on Security
Hacker News: Ask HN
Hacker News: Ask HN
N
Netflix TechBlog - Medium
L
LangChain Blog
博客园 - 叶小钗
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
M
MIT News - Artificial intelligence
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
W
WeLiveSecurity

博客园 - 技术已荒废

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();