|
-
February 2nd, 2010, 08:44 AM
#1
Calling another exe within a C# console application
Hi,
I need to know how to call a exe within a C# console program.
I tried the other stuffs that just open the exe and give parameters as command line arguments.
But my problem is, the exe i try to open the exe, it opens a form which has few text boxes and check boxes.
is there a way to pass arguments to the text boxes and check boxes that i have in the another exe from the existing C# console application?
Please help me.
-
February 2nd, 2010, 10:21 AM
#2
Re: Calling another exe within a C# console application
Your Form is still an exe that has a Program.cs that can take parameters. The Program.cs creates a new Form by calling the constructor. You can modify the constructor to take parameters that were received from the Program.cs entry point (Main).
From there you can auto-fill the textbox's with information.
-
February 2nd, 2010, 12:19 PM
#3
Re: Calling another exe within a C# console application
Just thought I'd mention... to do what mario has suggested will require that you modify the Form application.
-
February 2nd, 2010, 04:00 PM
#4
Re: Calling another exe within a C# console application
 Originally Posted by Arjay
Just thought I'd mention... to do what mario has suggested will require that you modify the Form application.
That's a good point. When I first saw the post I assumed that the source code for the target application was not available or that that application could not be changed.
-
February 3rd, 2010, 01:58 AM
#5
Re: Calling another exe within a C# console application
Sorry Friends!
I forgot to mention that i dont have the source code of the target exe that i am calling within the C# console application.
i am having the target exe alone which is openingthe form.
Now i need to pass input paramerters to the form that is opened.
Please help me
Sorry for not mentioning that i am not having the source code of the target exe
-
February 3rd, 2010, 02:42 AM
#6
Re: Calling another exe within a C# console application
 Originally Posted by sarathi_57
Sorry Friends!
I forgot to mention that i dont have the source code of the target exe that i am calling within the C# console application.
i am having the target exe alone which is openingthe form.
Now i need to pass input paramerters to the form that is opened.
Please help me
Sorry for not mentioning that i am not having the source code of the target exe
Then you simply can't do it. You can't pass command line params to an app and expect it to know what to do with the param if the app wasn't originally written to perform such behavior.
On the other hand you can simulate entering the data in the form through the UI. Search google for 'Active Accessibility'. What you would do is to start the exe, and then use AA to enter the data into the form.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|