Best way to read commandline parameters in console application

后端 未结 4 552
暗喜
暗喜 2021-01-01 14:52

Below are two ways of reading in the commandline parameters. The first is the way that I\'m accustom to seeing using the parameter in the main. The second I stumbled on wh

4条回答
  •  孤独总比滥情好
    2021-01-01 15:17

    To me the first way seems more intuitive because that is how I have been doing it since my C/C++ days.

    If your commandline has one too many switches please do take a look at getopt that Thomas recommends. It's quite useful. I haven't had a look at C# port of the same though.

    Regards,

    kgr

提交回复
热议问题