private void addToList(keySpace a) { if (a == keySpace.uppercase) { charList.AddRange(upperCase.ToList <string>()); } if (a == keySpace.lowercase) { charList.AddRange(lowerCase.ToList <string>()); } if (a == keySpace.numbers) { charList.AddRange(numbers.ToList <string>()); } if (a == keySpace.otherChars) { charList.AddRange(otherChars.ToList <string>()); } if (a == keySpace.hex) { if (charList.Count == 0) { charList.AddRange(hex.ToList <string>()); } else { throw new Exception("There was a problem contact tech support"); } } // remove duplicates if user has been stupit and // selected hex with another type charList = charList.Distinct <string>().ToList <string>(); }
public KeyGen(keySpace a) { keyLength = 10; charList = new List <string>(); addToList(a); rndGen = new RNGCryptoServiceProvider(); }
public KeyGen(keySpace a, keySpace b, keySpace c, keySpace d) : this(a, b, c) { addToList(d); }
public KeyGen(keySpace a, keySpace b, keySpace c) : this(a, b) { addToList(c); }
public KeyGen(keySpace a, keySpace b) : this(a) { addToList(b); }