1.产生500到600之间的随机数
Random rdm1 = new Random(unchecked((int)DateTime.Now.Ticks));
int i = rdm1.Next(500, 600);

2.产生小于500的随机数
Random rdm1 = new Random(unchecked((int)DateTime.Now.Ticks));
int i = rdm1.Next(500);

3.产生位数不定的随机数
Random rdm1 = new Random(unchecked((int)DateTime.Now.Ticks));
int i = rdm1.Next();

posted on 2008-10-21 10:32  小妮子  阅读(370)  评论(0编辑  收藏  举报