在.NET框架何时应该使用XML序列化与二进制序列化? [英] When should I use XML Serialization vs. Binary Serialization in the .NET framework?

查看:156
本文介绍了在.NET框架何时应该使用XML序列化与二进制序列化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很困惑 - 当我应该使用XML序列化,当我应该使用二进制序列化在.NET框架

I'm confused - when should I be using XML Serialization and when should I be using Binary Serialization in the .NET framework?

推荐答案

具体到.NET,如果你有使用相同类型的系统,比你可以使用二进制序列化两个应用程序。在另一方面,如果你有在不同的平台比它建议使用XML序列化的应用程序。所以,如果我写一个聊天应用程序(客户端和服务器),我可能会使用二进制序列化,但如果我后来决定,我应该使用Python编写客户端,比我可能不会。

Specific to .NET, If you have two applications that are using the same type system, than you can use binary serialization. On the other hand if you have applications that are in different platforms than it is recommended to use XML Serialization. So if i am writing a chat application(client and server), I might use binary serialization, but if i later decide that i should use python to write a client, than I may not.

这篇关于在.NET框架何时应该使用XML序列化与二进制序列化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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