private string RandomString(int size) { //TEMP VARS StringBuilder builder = new StringBuilder(); Random random = new Random(); char ch; int num = 0; string cm; char N1 = (Convert.ToChar(Convert.ToInt32(73))); char N2 = (Convert.ToChar(Convert.ToInt32(79))); char N3 = (Convert.ToChar(Convert.ToInt32(111))); char N4 = (Convert.ToChar(Convert.ToInt32(105))); /* This handles the randomizing of Letters and Numbers * Only 2-9 are used * All Letters except O,o, I, i */ for (int i = 0; i < size; i++) { Random r1 = new Random(); check4: int r2 = r1.Next(1, 3); if (test == 0) //This makes sure the first one is a letter r2 = 2; switch (r2) { case 1: //Gen the Number //Make sure more than 2 numbers never happen if (num == 2) { num = 0; goto case 2; } Random r3 = new Random(); Thread.Sleep(r1.Next(1,5)); num++; //Make sure only numbers used twice cm = (Convert.ToString(r3.Next(2, 9))); builder.Append(cm); r2 = 2; break; case 2: //Gen the Character test = 1; ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65))); if ((ch == N1) | (ch == N2) | (ch == N3) | (ch == N4)) { goto check4; } else { builder.Append(ch); break; } } } return builder.ToString().ToUpper(); //Return the string }
So then you can use like
codeString = RandomString(25);
Which generates a 25 character string which is the right size for Microsoft codes. Then you can max generate them into a text file and then split the code into 5 parts and dump it into xbox.com and keep trying until you get one that works. You can also mass enter them into xbox.com, but I got a simple HTTP ban from their website (Which expired after 24 hours) after I tried about 12,000. So I wouldn't recommend it.