Random Class
Password generator:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
//Define a variable with random class.
var rr = new Random();
//your password will contain 15 characters.
for (int ff = 0; ff < 15; ff++)
{
//since rr is defined as random class, it can now have parameters like next,
//nextbytes etc
//in ascii code, from 33 till 127 are characters for numberic, special
//characters, capital letter alphabets and small letter alphabets.
Console.Write((char)rr.Next(33,127));
}
Console.WriteLine();
}
}
}Last updated