How do I generate a random int number?

前端 未结 30 2619
长发绾君心
长发绾君心 2020-11-21 11:02

How do I generate a random integer in C#?

30条回答
  •  时光说笑
    2020-11-21 11:51

    Random rand = new Random();
    int name = rand.Next()
    

    Put whatever values you want in the second parentheses make sure you have set a name by writing prop and double tab to generate the code

提交回复
热议问题