I have a console application called MyTool.exe
What is the simplest way to collect the named arguments passed to this console applicaiton and then to put them in a
if you have a "=" in your parameter values, a safer option would be:
private static Dictionary ResolveArguments(string[] args)
{
if (args == null)
return null;
if (args.Length > 1)
{
var arguments = new Dictionary();
foreach (string argument in args)
{
int idx = argument.IndexOf('=');
if (idx > 0)
arguments[argument.Substring(0, idx)] = argument.Substring(idx+1);
}
return arguments;
}
return null;
}