0

I am developing an windows form application for some internal working.After building this application i need to call this exe file from another application. And need to get the process response. So can any one tell me how can i return some values from an application and how can i read that response in another application from where first application executed.

Ashish Rathore
  • 2,546
  • 9
  • 55
  • 91

2 Answers2

1

If this is a command-line application, you can read input data using command-line arguments and send out response on standard output device.

If it is a Windows application, you can use named pipes or WCF etc. If that's complicated, you can simply write output to a log file and then read that file from other applications.

dotNET
  • 33,414
  • 24
  • 162
  • 251
0

easy use:

http://msdn.microsoft.com/en-us/library/system.environment.exit.aspx

Environment.Exit(codetoreturn);

Use a non-zero number to indicate an error. In your application, you can define your own error codes in an enumeration, and return the appropriate error code based on the scenario. For example, return a value of 1 to indicate that the required file is not present and a value of 2 to indicate that the file is in the wrong format. For a list of exit codes used by the Windows operating system, see System Error Codes in the Windows documentation.

Nahum
  • 6,959
  • 12
  • 48
  • 69