.net中的平均共享内存是什么 [英] What is mean shared memory in .net

查看:67
本文介绍了.net中的平均共享内存是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C#.net中开发了两个exe控制台应用程序1和console应用程序2,现在第一个应用程序创建一个对象,类型为x类的``obj'',现在我要访问此创建的对象''obj

I have two exe say console application 1 and console application 2 ,devloped in c#.net.Now first application create one object say ''obj'' of type class x, now i want to access this created object ''obj'' in second application.

推荐答案

您需要使用序列化.两个最重要的原因是将对象的状态持久保存到存储介质,以便可以在以后的阶段重新创建精确的副本,并将对象按值从一个应用程序域发送到另一个应用程序域.例如,序列化用于在ASP.NET中保存会话状态并将对象复制到Windows窗体中的剪贴板.远程处理还使用它来按值将对象从一个应用程序域传递到另一个应用程序域

详细信息此处 [ .NET中的串行化 [在.NET中引入序列化 [
You need to use serialization. The two most important reasons are to persist the state of an object to a storage medium so an exact copy can be recreated at a later stage, and to send the object by value from one application domain to another. For example, serialization is used to save session state in ASP.NET and to copy objects to the clipboard in Windows Forms. It is also used by remoting to pass objects by value from one application domain to another

More info here[^]

Serialization in .NET[^]
Introducing Serialization in .NET[^]


这个有用的示例

在不同运行的应用程序之间共享内存 [ ^ ]
this helpful example

Sharing memory across different running applications[^]


我想你想要这样的东西.
使用另一个应用程序域中的对象 [什么是应用程序域 [ .NET Remoting [ AppDomain.CreateInstanceAndUnwrap方法 [ pass-data-between-application-domains [ ^ ]
I guess you want something like this.
Uses an object in another application domain[^]

What is Application-Domain[^]

You might interested in .NET Remoting[^] but its old now.

Read about AppDomain.CreateInstanceAndUnwrap Method [^]

pass-data-between-application-domains[^]


这篇关于.net中的平均共享内存是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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