在.NET框架何时应该使用XML序列化与二进制序列化?序列、化与、框架、序列化

2023-09-03 03:20:48 作者:等待雨、是伞一生的宿命

我很困惑 - 当我应该使用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.