C# random text and number
Last modified: June 29, 2021static void Main(string[] args)
{
Random random = new Random();
var random1 = random.Next(); //a random number
var random2 = random.Next(500); //random value upto 500
var random3 = random.Next(100, 500); //random from 100 to 500
string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
string randomTextAndNumber = new string(Enumerable.Repeat(chars, 6)
.Select(s => s[random.Next(s.Length)])
.ToArray()); //get random text and number
}