parsing command line parameters in c#

You would think of all the nice features they have in .Net that parsing comand line parameters to a console app would be as easy as calling a property. You would be wrong. C'mon, how hard would it have been to have Environment.GetCommandLineArgsByName(string argname) ?

I don't think in zero-based arrays so I didn't want to be tied to using Environment.GetCommandLineArgs. I looked for other ways to do it and ran across a post on the NUnitAddin blog about using an XmlSerializer to parse them.  Cool. Very cool. Very little code and it makes sense (even before you understand it completely).

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s