hai consider that my application name is sApp.exe
when i run my application as
sApp.exe < myValue>
my application should start and i want to get that myValue in my application
how i can do this?
hai consider that my application name is sApp.exe
when i run my application as
sApp.exe < myValue>
my application should start and i want to get that myValue in my application
how i can do this?
Edit: For WPF use string[] args = Environment.GetCommandLineArgs();
For other applications(not WPF):
static void Main(string[] args)
{
foreach (string argument in args)
Console.WriteLine(argument);
}
If you want the first argument use args[0]
, but be sure to check the length of the array before accessing it.