与其副本共享文本的程序(打开两次) [英] A program sharing TEXT with its copy (opened twice)

查看:18
本文介绍了与其副本共享文本的程序(打开两次)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试做的是一个简单的程序,其中有 2 个文本框和一个按钮.(还有更多但无需多言以解决我的问题)
当我在第一个文本框中写入文本并单击按钮时,它将被写入第二个文本框中.这里一切正常.
现在,当我多次运行该程序时,我希望将文本写入其他程序的第二个文本框中.
抱歉我之前给你的解释不好,希望能更好:)

What i'm trying to do, is a simple program where i have 2 textboxes, and a button.(there is more but no need to say for resolving my problem)
When i write text in the 1st textbox and click the button, it will be written in the 2nd textbox. Everything is ok here.
Now, when i run this program more than once, i want the text to be written in the 2nd textbox of the others programs.
Sorry for the bad explaination i gave you before, hope it's better :)

旧描述
我实际上正在尝试制作一个非常像信使(基本上2个文本框,1个发送,1个查看,还有一个按钮发送),我不知道如何将程序与其自身链接(副本).
我希望它能够读取包含的文本框在其他副本中,我不希望它是具有 2 个表单的 1 个程序,但是 1 个单一形式,运行严重次数(2 个或更多)
我怎么办去做?
/!\ 注意:它将在一台计算机上,就像 2表格!

OLD DESCRIPTION
i'm actually trying to make a program that works pretty much like a messenger (basically 2 textboxes, 1 to send, 1 to view, and a button to send) and i can't figure out how to link the program with itself (copies).
I want it to be able to read the textboxes contained in the other copies and i don't want it to be 1 program with 2 forms, but 1 single form, running severeal times (2 or more)
How can i do that?
/!\ NOTE : It will be on a single computer, just like 2 forms!

推荐答案

你将不得不做一些IPC,分别是remoting.

您可以使用:

  • anonymous pipes
  • named pipes
  • UDP
  • TCP
  • WCF (would be overkill IMHO)
  • windows messaging (would be the easiest way)

这篇关于与其副本共享文本的程序(打开两次)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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