This program is suppose to generate a random license plate number. The first 3 characters are letters and the second 3 characters are numbers. For some reason the second two letters always appear as the same letter and all three numbers remain as the same number.
For example it will appear like this WKK-555 when I want all characters to be random.
What am I doing wrong?
// This is how the license plates are randomly created.
StringBuilder sb = new StringBuilder();
// first randomly chosen capital alphabetic character.
Random rng1 = new Random();
char C1;
int firstCharIndex = -1;
string specialStr1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
firstCharIndex = rng1.Next(0, specialStr1.Length);
C1 = specialStr1[firstCharIndex];
sb.Append(C1);
// second randomly chosen capital alphabetic character.
Random rng2 = new Random();
char C2;
int secondCharIndex = -1;
string specialStr2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
secondCharIndex = rng2.Next(0, specialStr2.Length);
C2 = specialStr2[secondCharIndex];
sb.Append(C2);
// third randomly chosen capital alphabetic character.
Random rng3 = new Random();
char C3;
int thirdCharIndex = -1;
string specialStr3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
thirdCharIndex = rng2.Next(0, specialStr3.Length);
C3 = specialStr3[thirdCharIndex];
sb.Append(C3);
// hyphen
char C4;
int fourthCharIndex = 0;
string specialStr4 = "-";
C4 = specialStr4[fourthCharIndex];
sb.Append(C4);
// first randomly selected digit.
Random rng5 = new Random();
char C5;
int fifthCharIndex = -1;
string specialStr5 = "0123456789";
fifthCharIndex = rng5.Next(0, specialStr5.Length);
C5 = specialStr5[fifthCharIndex];
sb.Append(C5);
// second randomly selected digit.
Random rng6 = new Random();
char C6;
int sixthCharIndex = -1;
string specialStr6 = "0123456789";
sixthCharIndex = rng6.Next(0, specialStr6.Length);
C6 = specialStr6[sixthCharIndex];
sb.Append(C6);
// third randomly selected digit.
Random rng7 = new Random();
char C7;
int seventhCharIndex = -1;
string specialStr7 = "0123456789";
seventhCharIndex = rng7.Next(0, specialStr7.Length);
C7 = specialStr7[seventhCharIndex];
sb.Append(C7);
// our license plate!!!
LicensePlateTextBox.Text = sb.ToString();