A quick Google for "
C# pass arguments between applications"
Found me this, as well as other tips.
Quote:
- System.Diagnostics.ProcessStartInfo otherApp = new System.Diagnostics.ProcessStartInfo("file.exe");
-
-
otherApp.Arguments = "args here";
-
-
Process.Start(otherApp);
in the Arguments property, insert there the arguments you want to give your other application. It will then recieve it and if its your own application you can either modify the main() method of it to accept the string[] arguments/parameters:
- static void Main(string[] args)
-
{
-
-
if (args.Length > 0)
-
{
-
Console.Write("args length: " + args.Length.ToString());
-
Console.Write("\n\n");
-
foreach (string curArg in args)
-
{
-
Console.WriteLine(curArg);
-
}
-
}
-
else
-
{
-
Console.WriteLine("No args supplied");
-
}
-
-
}
as an example. Or you can use the Environment.GetCommandLineArgs(); which returns a string[] array of arguments given to the application.
Please let us know if this helped you.