[RESOLVED] Passing Program Startup Parameters To A Windows Program
How do I get the startup parameters passed to my WINDOWS program.
I would like to pass parameters to my program such as this...
myprogram.exe c:\mytextfile.txt
Re: Passing Program Startup Parameters To A Windows Program
Are you asking how to pass them when you're debugging or how to retrieve them in code? If you're atlking about retrieving them in code use Environment.GetCommandLineArgs.
Re: Passing Program Startup Parameters To A Windows Program
i was wondering how to retrieve the args with code so the Enviroment.GetCommandLineArgs() worked
Thanks again
Re: [RESOLVED] Passing Program Startup Parameters To A Windows Program
Also, they are passed to the static Main() method of your program's startup class.
Code:
static void Main(string[] args)
{
// ...
}