Загрузка...

Help with cysel generator in C#

Thread in C# created by Quintin_inactive5175316 Apr 26, 2022. 316 views

  1. Quintin_inactive5175316
    Quintin_inactive5175316 Topic starter Apr 26, 2022 Banned 268 Mar 27, 2022
    [IMG]
    Есть вот такая виндовс форма
    В которой при нажатии на кнопку1
    будет выводиться рандомно сгенерированный 8 значный код от 0-9
    В текст бок 1
    Буду очень благодарен если скинут готовый код ♥
     
  2. Q_Q
    Q_Q Apr 26, 2022 225 Apr 22, 2022
    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
     
    1. View previous comments (2)
    2. Q_Q
    3. Quintin_inactive5175316 Topic starter
      Q_Q, этот код не ворк на 4.7.1 фрэйме
    4. Quintin_inactive5175316 Topic starter
      Q_Q, из за команды Rnd
    5. View the next comments (2)
  3. Quintin_inactive5175316
    Quintin_inactive5175316 Topic starter Apr 26, 2022 Banned 268 Mar 27, 2022
    А забыл добавить на 4 фрэйме должно быть
     
  4. r1soX
    r1soX Apr 28, 2022 231 Oct 14, 2017
    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());
    }
     
Top
Loading...