Generate a random integer in C#
private static readonly Random random = new Random();
private static readonly object lock_random = new object();
public static int GetRandomNumber(int min, int max)
{
lock (lock_random)
{
return random.Next(min, max);
}
}
private static readonly object lock_random = new object();
public static int GetRandomNumber(int min, int max)
{
lock (lock_random)
{
return random.Next(min, max);
}
}