如何在本地计算机中的两个或多个exe之间传递对象(例如:TextBox ....或其他对象) [英] How can I pass an object(Ex: TextBox.... or other object) between two or more exe in Local computer

查看:64
本文介绍了如何在本地计算机中的两个或多个exe之间传递对象(例如:TextBox ....或其他对象)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想构建项目,并且可以在两个或多个exe之间传递和对象(例如TextBox ...),但是我不知道该怎么办.所以请您帮忙发送示例项目....预先感谢...

I want to build project and can pass and object(EX: TextBox...) between two or more exe but I don''t know what should I do it. so please have a kindness to help send an example project.... Thank in advance...

推荐答案




这称为序列化.请看下面的文章以获取更多信息:
它将对象转换为文件,然后第二个过程可以反序列化读取此文件.
您甚至可以通过套接字通过网络发送此文件,然后在电线的另一端反序列化它:).

使用C#进行对象序列化 [
Hi,


This is called Serialization. Look at the article below to have more informations :
it convert an object to a file, then the second process could read this file deserialize.
You can even send this file through the network by a socket and deserialize it on the other side of the wire :).

Object Serialization using C#[^]




Best regards.
EL GAABEB.


两个不同的EXE意味着两个不同的进程,并且进程内存空间完全隔离.因此,尝试共享控件之类的任何组件都会适得其反.必要时,交换应在语义数据级别进行.看一下Timberbird对这个问题的评论,它只是传递Text属性的值-这是一种健康的方法.从更一般的角度来看,您需要在单独的数据层中开发数据模型,并仅传递数据实例.

通常,至少可以说,流程之间的集成没有取得丰硕的成果.集成应该在入口程序集引用到单个进程的组件程序集(类库)级别进行.

—SA
Two different EXEs mean two different processes, and the process memory space are perfectly isolated. Therefore, an attempt to share any components like controls is counter-productive. The exchange, when needed, should be performed at the level of semantic data. Look at the comment to the question by Timberbird, about passing just the value of the Text property — this is a healthy approach. In a more general view, you need to develop a data model in a separate data layer and pass only the data instances.

Generally, integration between processes in not fruitful, to tell the least. Integration should be done at the level of component assemblies (class library) referenced by an entry assembly into a single process.

—SA


这篇关于如何在本地计算机中的两个或多个exe之间传递对象(例如:TextBox ....或其他对象)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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