How do I Generate Random Number in C#?
By  Mahesh Chand October 05, 2005

This code snippet shows how to you generate a random number between a range in C#.

The following code snippet shows how to generate a random number between a range in C#, where min and max are minimum and maximum range of the new number.

private int RandomNumber(int min, int max)
{
Random random = new Random();
return random.Next(min, max);
}