Quantcast
Channel: Tópicos
Viewing all articles
Browse latest Browse all 14700

[Resolvido] Chave aleatória

$
0
0
Boa noite, Cá fica outra solução baseada na primeira solução: public static char GetLetter() { string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; Random rand = new Random(); int num = rand.Next(0, chars.Length - 1); return chars[num]; } private string geraChave() { string key = "" + GetLetter() + GetLetter() + GetLetter() + "-" + GetLetter() + GetLetter() + GetLetter() + "-" + GetLetter() + GetLetter() + GetLetter() + ""; return key; } Cordiais cumprimentos, Apocsantos

Viewing all articles
Browse latest Browse all 14700