Есть вот такая виндовс форма В которой при нажатии на кнопку1 будет выводиться рандомно сгенерированный 8 значный код от 0-9 В текст бок 1 Буду очень благодарен если скинут готовый код ♥
Random rnd = new Random(); int month = rnd.Next(1, 13); // creates a number between 1 and 12 int dice = rnd.Next(1, 7); // creates a number between 1 and 6 int card = rnd.Next(52); // creates a number between 0 and 51
private static Random random = new Random(); public static string RandomString(int length) //Где length - это длина пароля { const string chars = "0123456789"; //Сюда можно вставлять любые буквы, символы, знаки и т.д return new string(Enumerable.Repeat(chars, length) .Select(s => s[random.Next(s.Length)]).ToArray()); } C# private static Random random = new Random(); public static string RandomString(int length) //Где length - это длина пароля { const string chars = "0123456789"; //Сюда можно вставлять любые буквы, символы, знаки и т.д return new string(Enumerable.Repeat(chars, length) .Select(s => s[random.Next(s.Length)]).ToArray()); }