方法是否也与 .NET 中的数据成员一起序列化? [英] Are methods also serialized along with the data members in .NET?

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

问题描述

标题很明显,我需要知道方法是否与 C# 中的对象实例一起序列化,我知道它们在 Java 中没有,但我对 C# 有点陌生.如果他们不这样做,我是否必须在将其发送到另一台 PC 时将带有字节流(序列化对象)的原始类放在一个包中?原来的类可以像一个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天全站免登陆