By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,053 Members | 1,595 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,053 IT Pros & Developers. It's quick & easy.

Command line arguments

P: n/a
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
Jul 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hari <an*******@discussions.microsoft.com> wrote:
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.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2

P: n/a
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
-----Original Message-----
Hari <an*******@discussions.microsoft.com> wrote:
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 aparameter, and then the command line arguments will be in the stringarray.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
.

Jul 21 '05 #3

P: n/a
Project (menu) > xxx Properties > Configuration properties > Debugging >
Start Options > Command Line Arguments

Yves

"Hari" <an*******@discussions.microsoft.com> schreef in bericht
news:04****************************@phx.gbl...
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
-----Original Message-----
Hari <an*******@discussions.microsoft.com> wrote:
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.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
.

Jul 21 '05 #4

P: n/a
As for reading the command line parameters, you can also use
System.Environment.CommandLine or System.Environment.GetcommandLineArgs()
"phoenix" <pa******@skynetWORK.be> wrote in message
news:ed**************@TK2MSFTNGP09.phx.gbl...
Project (menu) > xxx Properties > Configuration properties > Debugging >
Start Options > Command Line Arguments

Yves

"Hari" <an*******@discussions.microsoft.com> schreef in bericht
news:04****************************@phx.gbl...
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
-----Original Message-----
Hari <an*******@discussions.microsoft.com> wrote:
> 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.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
.


Jul 21 '05 #5

P: n/a
Thank you

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

"phoenix" <pa******@skynetWORK.be> wrote in message
news:ed**************@TK2MSFTNGP09.phx.gbl...
Project (menu) > xxx Properties > Configuration properties > Debugging > Start Options > Command Line Arguments

Yves

"Hari" <an*******@discussions.microsoft.com> schreef in bericht news:04****************************@phx.gbl...
> 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
>
>
>
> >-----Original Message-----
> >Hari <an*******@discussions.microsoft.com> wrote:
> >> 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.
> >
> >--
> >Jon Skeet - <sk***@pobox.com>
> >http://www.pobox.com/~skeet
> >If replying to the group, please do not mail me too
> >.
> >


.

Jul 21 '05 #6

P: n/a
In your projects property page, choose Configuration Properties.
You can specify Command line arguments there.

Thanks

Jason

Jul 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.