Command line arguments

H

Hari

can i have command line arguments in VS.NET applicatio?
if yes how?
Can i have some code snippets of the above functionality?

I know we can acjieve this in console application form
command prompt but how can i achieve it in an application
in VS.NET?

Thank you
 
J

Jon Skeet [C# MVP]

Hari said:
can i have command line arguments in VS.NET applicatio?
if yes how?
Can i have some code snippets of the above functionality?

I know we can acjieve this in console application form
command prompt but how can i achieve it in an application
in VS.NET?

Exactly the same way - make your Main method take a string array as a
parameter, and then the command line arguments will be in the string
array.
 
H

Hari

Thank you for the reply Jon Skeet

But if i want to pass the command line arguments at run
time how can i do in the VS.NET environment.

Thank you in advance
 
P

phoenix

Project (menu) > xxx Properties > Configuration properties > Debugging >
Start Options > Command Line Arguments

Yves
 
D

Donald L. Mull Jr.

As for reading the command line parameters, you can also use
System.Environment.CommandLine or System.Environment.GetcommandLineArgs()
 
G

Guest

Thank you

Donald
-----Original Message-----
As for reading the command line parameters, you can also use
System.Environment.CommandLine or System.Environment.GetcommandLineArgs()





.
 
J

Jason He

In your projects property page, choose Configuration Properties.
You can specify Command line arguments there.

Thanks

Jason
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top