Comand line parameters in Visual Studio

  • Thread starter Thread starter CSharpUser
  • Start date Start date
C

CSharpUser

How do I pass in command line parameters to the program at
startup in Visual Studio.

This is similar to doing csc program arg1 arg2.

I want to achieve the same effect running the program in
Visual Studio and pressing F5
 
Declare your startup main procedure like this

static void Main(string[] cmdLine )

and then you can parse the cmdLine string array.


Hope this helps.
Cybertof.
 
CSharpUser said:
How do I pass in command line parameters to the program at
startup in Visual Studio.

Project Properties, Configuration Properties, Debugging. There is a line
(under Startup Options) called "Comand Line Arguments".
This is similar to doing csc program arg1 arg2.

No. csc is the COMPILER. do ou want to pass parameters oto the compiler or
your program?
I want to achieve the same effect running the program in
Visual Studio and pressing F5

As said.

Thomas Tomiczek
THONA Software & Consulting Ltd.
(Micrsofot MVP C#/.NET)
 
Thanks. That is what I was looking for.
-----Original Message-----


Project Properties, Configuration Properties, Debugging. There is a line
(under Startup Options) called "Comand Line Arguments".


No. csc is the COMPILER. do ou want to pass parameters oto the compiler or
your program?


As said.

Thomas Tomiczek
THONA Software & Consulting Ltd.
(Micrsofot MVP C#/.NET)


.
 
Back
Top