Software Development Network>> Visual C#>> Pass paramters to applications when executing?
Hi,
How do you pass a parameter to an application when executing an application
E.g. "MyApp.exe -parameter".
Thanks,
Weiran.
Sorry I don't think I was very clear. I know how to send the parameters, but how do you read them in the application
I'm also using a Windows Forms app not console.
Thanks.
Ahh of course! I've done it in Java before too, but somehow completely forgot!
Thanks!
Commandline parameters are passed into the string array of the main-method:
static void Main(string[] args)
where you can access them just like you would do with any other array.
Pass paramters to applications when executing?
zacksz
Are you working with Console Applications In Console Applications you can send any information by the help of command line arguments.
Michael K Campbell
http://msdn2.microsoft.com/en-us/library/acy3edy3(VS.80).aspx
Sh Dr Cn
cevans
Sorry I don't think I was very clear. I know how to send the parameters, but how do you read them in the application
I'm also using a Windows Forms app not console.
Thanks.
M-Star
Ahh of course! I've done it in Java before too, but somehow completely forgot!
Thanks!
cyphorous
Commandline parameters are passed into the string array of the main-method:
static void Main(string[] args)
where you can access them just like you would do with any other array.