472,356 Members | 2,060 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,356 software developers and data experts.

Command line arguments

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
6 2366
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
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
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
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
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
In your projects property page, choose Configuration Properties.
You can specify Command line arguments there.

Thanks

Jason

Jul 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jon Hewer | last post by:
hi i am writing a little script and currently implementing command line arguments following the guide by mark pilgrim from dive into python; ...
7
by: Steve M | last post by:
I'm trying to invoke a Java command-line program from my Python program on Windows XP. I cannot get the paths in one of the arguments to work right. The instructions for the program describe the...
2
by: SunRise | last post by:
Hi I am creating a C Program , to extract only-Printable-characters from a file ( any type of file) and display them. OS: Windows-XP Ple help me to fix the Errors & Warnings and explain...
1
by: amirmira | last post by:
I would like to set command line arguments to a service at install time. I need to do this because I need to get information from different registry locations depending on my command line argument....
6
by: Hari | last post by:
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...
1
by: Rune Jacobsen | last post by:
Hi, I've been trying to figure this one out, but my experience just doesn't have what it takes... :| I am writing an application that reads an XML file and displays the contents in various...
40
by: raphfrk | last post by:
I have a program which reads in 3 filenames from the command line prog filename1 filename2 filename3 However, it doesn't work when one of the filenames has spaces in it (due to a directory...
2
by: Milan | last post by:
Hi, Please guide me how to set command line argument and how to retrive command line argument. Senario: vb.net application should be able to execute from command prompt by passing login and...
7
by: Jwe | last post by:
Hi, I've written a program which has both a command line interface and Windows form interface, however it isn't quite working correctly. When run from command line with no arguments it should...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
0
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.