Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C# (http://www.go4expert.com/forums/c-sharp/)
-   -   Passing command line arguments to exe coded in C# (http://www.go4expert.com/forums/passing-command-line-arguments-exe-t25243/)

Mobalak88 14Mar2011 10:09

Passing command line arguments to exe coded in C#
 
Hi all,

I am using both the forms and command line arguments in my C# project. The progra must execute in this way :

If the command line arguments are given by the user, the exe must consider that as the input and process. Else it should display the form to the user for the input.

It is working fine if it is executed in the visual studio but if we ompile and create the exe with the command line args, it is taking those input as the default and processing with out considering the user input. If compliled with out the arguments, it is displaying the form.

I hope some one would have a solution. Please post your replies as soon as possible since it is urgent.

Thanks in advance

Regards,

Mobalak88

shabbir 14Mar2011 10:12

Re: Passing command line arguments to exe coded in C#
 
How are you passing the command line input to the final compiled exe?

Mobalak88 14Mar2011 15:35

Re: Passing command line arguments to exe coded in C#
 
I have a seperate class commandLineParser defined which reads the command line arguments from the main and parses them.

Mobalak88 15Mar2011 09:35

Re: Passing command line arguments to exe coded in C#
 
in DOS, i will set the path, then


filename.exe -darg1 -farg2 etc.


All times are GMT +5.5. The time now is 04:59.