📅  最后修改于: 2022-03-11 14:59:15.895000             🧑  作者: Mango
//Function to get random number
private static readonly Random getrandom = new Random();
public static int GetRandomNumber(int min, int max)
{
lock(getrandom) // synchronize
{
return getrandom.Next(min, max);
}
}