Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region Commandline switch handling
- Dictionary<string, string> switchMap = new Dictionary<string, string>();
- for (int i = 0; i < args.Length; i++)
- {
- if (args[i][0] == '/' && args[i].Length > 1) //valid switch
- {
- int splitIndex;
- if ((splitIndex = args[i].IndexOf(':')) > 1) //check if the switch has a value assigned to it
- switchMap.Add(args[i].Substring(1, splitIndex - 1), args[i].Substring(splitIndex + 1));
- else
- switchMap.Add(args[i].Substring(1), string.Empty);
- }
- }
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement