0

Question, I have two applications. I set a doubleclick event on the first one that opens app called employees. I want to copy the data in label1 from application one onto the txtone of the second application and hit the run button.

This is the code i have for opening the 2nd app but i cant figure out how to compile the rest. Any suggestions would be great!

Process Employees= new Process();           
Employees.StartInfo.FileName = "F:\\Employees.exe";     
Employees.Start();
Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
hex c
  • 705
  • 2
  • 13
  • 22
  • http://stackoverflow.com/questions/528652/what-is-the-simplest-method-of-inter-process-communication-between-2-c-sharp-pro – Jonesopolis Jul 24 '13 at 12:48

3 Answers3

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
}
FreddieH
  • 773
  • 8
  • 18
0

doesn't sound like a particularly neat solution however have you considered adding arguments to the start

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

RoughPlace
  • 1,111
  • 1
  • 13
  • 23
0

You can do this via multiple ways. Possible options are

  1. MSMQ

  2. Remoting

  3. FileWatcher

  4. Arguement Passing

Ehsan
  • 31,833
  • 6
  • 56
  • 65