0

How do I make my program check if it launched with given options like this

"C:\bla\blabla\myapp\myapp.exe" -NoUpdateCheck -NoInt

or

"C:\bla\blabla\myapp\myshortcut.lnk" -NoUpdateCheck -NoInt

Or just with one option.

Eren
  • 185
  • 1
  • 12
  • 1
    Possible duplicate of [Best way to parse command line arguments in C#?](http://stackoverflow.com/questions/491595/best-way-to-parse-command-line-arguments-in-c) – Lukas Kabrt Dec 10 '15 at 18:24

2 Answers2

1

You use System.Environment.Commandline to read the full command line and parse it.

The Sharp Ninja
  • 1,056
  • 11
  • 17
0

Use a command line argument parser and save yourself from re-inventing the wheel. I use this one for everything : http://commandlinearguments.codeplex.com/

flapster
  • 43
  • 5