0

问题,我有两个应用程序。我在第一个打开名为员工的应用程序的事件上设置了双击事件。我想将 label1 中的数据从应用程序一复制到第二个应用程序的 txtone 中,然后单击运行按钮。

这是我打开第二个应用程序的代码,但我不知道如何编译其余的。任何建议都会很棒!

Process Employees= new Process();           
Employees.StartInfo.FileName = "F:\\Employees.exe";     
Employees.Start();
4

3 回答 3

1

You can pass the data with arguments like this:

Employees.StartInfo.Arguments = your_argument

In your employee app you can retrieve the data in the Program class Main method with the args parameter.

private static void Main(string[] args)
{
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    Application.Run(new FormMain(args)); //pass arguments to main form
}
于 2013-07-24T12:51:47.087 回答
0

听起来不是一个特别巧妙的解决方案,但是您是否考虑过在开始时添加参数

http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.arguments.aspx

于 2013-07-24T12:49:52.043 回答
0

您可以通过多种方式做到这一点。可能的选项是

  1. MSMQ

  2. 远程处理

  3. 文件观察器

  4. 论证传递

于 2013-07-24T12:50:34.090 回答