生成随机数
1,
System.Random random = new Random( Convert.ToInt32(DateTime.Now.Millisecond ));
(使用System.Random random = new Random(Convert.ToInt32(DateTime.Now.Ticks));的时候提示错误:Value was either too large or too small for an Int32.),无奈)
memoEdit1.Text = random.Next(0, 39).ToString();
2,
看到有比较简单的
Random rd = new Random();
memoEdit1.Text= rd.Next(0, 39).ToString();
System.Random random = new Random( Convert.ToInt32(DateTime.Now.Millisecond ));
(使用System.Random random = new Random(Convert.ToInt32(DateTime.Now.Ticks));的时候提示错误:Value was either too large or too small for an Int32.),无奈)
memoEdit1.Text = random.Next(0, 39).ToString();
2,
看到有比较简单的
Random rd = new Random();
memoEdit1.Text= rd.Next(0, 39).ToString();