C#序列化 [英] c# serialization

查看:131
本文介绍了C#序列化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试在两种软件之间传递数据,一种在PC上运行,另一种在智能设备上运行.

显而易见的方法是通过序列化来传递数据.紧凑的框架不支持二进制序列化,因此我必须使用XML.

创建模式时,某些行指向程序中DataType的指定路径(例如namespace.someclass ...)

例如...

Hi,

I''m trying to pass data between two softwares, one is running on a PC and the other is on a smart device.

The obvious way is to pass data is by serialization. The compact framework doesn''t support binary serialization, so I have to use XML.

When I create a schema, some of the lines point to a specified path in the program for the DataType (like namespace.someclass...)

example...

xs:element name="c" msdata:DataType="<big>Serializetest.base0, Serializetest</big>, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" type="xs:anyType" minOccurs="0" 



当我尝试在智能设备上打开架构时,出现错误,因为我使用了不同的命名空间.

我可以使用相同的名称空间...但是应该有更好的方法.



When I''m trying to open the schema on a smart device, I''m getting an error, because the I use different namespace.

I could use same namespace... but there should be a better way.

推荐答案

记住一件事,您可以序列化基本类型或具有序列化的复杂自定义类型.

如果您引用一个dll,则还需要序列化该dll并将其发送给客户端.

;)
Remember one thing you can serialize either basic type or complex custom types which has its serialization.

If you have a reference to one dll, you also need to serialize the dll and send to the client.

;)


这篇关于C#序列化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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