📜  时间:2018-08-10 标签:c#getrandomint-whatever代码示例

📅  最后修改于: 2022-03-11 14:59:15.895000             🧑  作者: Mango

代码示例4
//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);
    }
}