Command Line Arguments

Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jul 2005
Posts: 1,542
Reputation: tayspen is on a distinguished road 
Solved Threads: 98
Team Colleague
tayspen's Avatar
tayspen tayspen is offline Offline
<Insert title here>

Command Line Arguments

 
0
  #1
Dec 9th, 2005
How can these be done. For example running a shourtcut thats path is this

C:\app.exe -sync

will run a certain part of the application(the sync function). Do i need to make a seperate application. Also say i have a program that plays music files. then i have a music file that i right click and select to open with ,my proggie. How could i make it so that it knows to play that file?

i hope thats clear. The main thing i would like to know is the command line arguments.

-T
Firefox
Ewido
Tune up windows
Get detailed system information
My Fixes

Member - Alliance of Security Analysis Professionals - Since 2006
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 45
Reputation: _r0ckbaer is an unknown quantity at this point 
Solved Threads: 7
_r0ckbaer's Avatar
_r0ckbaer _r0ckbaer is offline Offline
Light Poster

Re: Command Line Arguments

 
0
  #2
Dec 9th, 2005
Try the Environment.GetCommandLineArgs() method
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,542
Reputation: tayspen is on a distinguished road 
Solved Threads: 98
Team Colleague
tayspen's Avatar
tayspen tayspen is offline Offline
<Insert title here>

Re: Command Line Arguments

 
0
  #3
Dec 9th, 2005
Originally Posted by _r0ckbaer
Try the Environment.GetCommandLineArgs() method
Ok, thanks i check it out.

-T
Firefox
Ewido
Tune up windows
Get detailed system information
My Fixes

Member - Alliance of Security Analysis Professionals - Since 2006
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 206
Reputation: plazmo is an unknown quantity at this point 
Solved Threads: 16
plazmo's Avatar
plazmo plazmo is offline Offline
Posting Whiz in Training

Re: Command Line Arguments

 
0
  #4
Dec 9th, 2005
static void Main(string[] args)
{
}

make your Main look like this and "args" is a string array of all the args passed
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,542
Reputation: tayspen is on a distinguished road 
Solved Threads: 98
Team Colleague
tayspen's Avatar
tayspen tayspen is offline Offline
<Insert title here>

Re: Command Line Arguments

 
0
  #5
Dec 9th, 2005
Originally Posted by plazmo
static void Main(string[] args)
{
}

make your Main look like this and "args" is a string array of all the args passed
Hey, thanks ive searched the web and ound some examples...and i will continue to mess around with it.

-T
Firefox
Ewido
Tune up windows
Get detailed system information
My Fixes

Member - Alliance of Security Analysis Professionals - Since 2006
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 13
Reputation: chan_lemo is an unknown quantity at this point 
Solved Threads: 1
chan_lemo chan_lemo is offline Offline
Newbie Poster

Re: Command Line Arguments

 
0
  #6
Apr 1st, 2009
C# program accept arguments in the order of args[0], args[1] etc.

Console.WriteLine("Arguments-1 " + args[0]+" Argument-2 "+args[1]);

read full source code
http://csharp.net-informations.com/o...line-tools.htm

chan.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC