.NET中的数据成员还有序列化方法吗? [英] Are methods also serialized along with the data members in .NET?

查看:106
本文介绍了.NET中的数据成员还有序列化方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标题很明显,我需要知道方法是否与C#中的对象实例一起序列化,我知道它们不在Java中,但我对C#有一点新意。如果没有,当发送到另一台电脑时,是否必须将包含字节流(序列化对象)的原始类放在一个包中?原来的类可以像一个DLL文件吗?

解决方案

类型信息与状态一起被序列化。为了反序列化数据,您的程序将需要访问包含类型(包括方法)的程序集。


The title is obvious, I need to know if methods are serialized along with object instances in C#, I know that they don't in Java but I'm a little new to C#. If they don't, do I have to put the original class with the byte stream(serialized object) in one package when sending it to another PC? Can the original class be like a DLL file?

解决方案

No. The type information is serialized, along with state. In order to deserialize the data, your program will need to have access to the assemblies containing the types (including methods).

这篇关于.NET中的数据成员还有序列化方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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