473,395 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 2585
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.