随机数

基本类型 / 数字 / 整型

using System;

Random rand = new Random();
var random = rand.Next(3);
//random is 0, 1 or 2    

Console.WriteLine(random);