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 Dictionarty<string, string>()
which will have the argument name as the key and the value as the argument?
for example:
MyTool foo=123432 bar=Alora barFoo=45.9
I should be able to obtain a dictionary which will be:
MyArguments["foo"]=123432
MyArguments["bar"]="Alora"
MyArguments["barFoo"]="45.9"
Here's how this can be done in the most simple way:
Note that:
I don't see why this code is bad? hova?
Use this Nuget package
Takes seconds to configure and adds instant professional touch to your application.
if you have a "=" in your parameter values, a safer option would be: