예제 #1
0
파일: KeyGen.cs 프로젝트: Iqrahaq/CSharp
 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>();
 }
예제 #2
0
파일: KeyGen.cs 프로젝트: Iqrahaq/CSharp
 public KeyGen(keySpace a)
 {
     keyLength = 10;
     charList  = new List <string>();
     addToList(a);
     rndGen = new RNGCryptoServiceProvider();
 }
예제 #3
0
파일: KeyGen.cs 프로젝트: Iqrahaq/CSharp
 public KeyGen(keySpace a, keySpace b, keySpace c, keySpace d)
     : this(a, b, c)
 {
     addToList(d);
 }
예제 #4
0
파일: KeyGen.cs 프로젝트: Iqrahaq/CSharp
 public KeyGen(keySpace a, keySpace b, keySpace c)
     : this(a, b)
 {
     addToList(c);
 }
예제 #5
0
파일: KeyGen.cs 프로젝트: Iqrahaq/CSharp
 public KeyGen(keySpace a, keySpace b)
     : this(a)
 {
     addToList(b);
 }