SHARE
TWEET

Untitled

a guest Feb 21st, 2020 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #region Commandline switch handling
  2. Dictionary<string, string> switchMap = new Dictionary<string, string>();
  3.  
  4. for (int i = 0; i < args.Length; i++)
  5. {
  6.     if (args[i][0] == '/' && args[i].Length > 1) //valid switch
  7.     {
  8.         int splitIndex;
  9.         if ((splitIndex = args[i].IndexOf(':')) > 1) //check if the switch has a value assigned to it
  10.             switchMap.Add(args[i].Substring(1, splitIndex - 1), args[i].Substring(splitIndex + 1));
  11.         else
  12.             switchMap.Add(args[i].Substring(1), string.Empty);
  13.     }
  14. }
  15. #endregion
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top