string[] tmp = new string[]{"0","1","2","3",.... ,"A","B"...}; System.Random rd = new Random(); string result = ""; for(int i=0;i<4;i++) { int aaa = rd.Next(36); result += tmp[aaa]; }
string[] s = new string[36]{"0","1","2","3","4" ,"5","6","7","8","9", "A","B","C","D","E","F","G" ,"H","I","J","K","L" ,"M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"}; string result = ""; System.Random r = new Random(); for(int i = 0;i < 4; i ++) { result += s[r.Next(36)]; }
System.Random rd = new Random();
string result = "";
for(int i=0;i<4;i++)
{
int aaa = rd.Next(36);
result += tmp[aaa];
}
,"5","6","7","8","9",
"A","B","C","D","E","F","G"
,"H","I","J","K","L"
,"M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"}; string result = "";
System.Random r = new Random();
for(int i = 0;i < 4; i ++)
{
result += s[r.Next(36)];
}
MessageBox.Show(result);