如何从123开始产生否 [英] how to generate a no starting from 123
本文介绍了如何从123开始产生否的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都可以....
如何从123开始不生成一个
我的编码.....
can any one ans....
how to generate a no starting from 123
my coding.....
public void publickey()
{
Random rand = new Random((int)DateTime.Now.Ticks);
int numIterations = 0;
numIterations = rand.Next(6745, 9876);
Label5.Text = numIterations.ToString();
}
推荐答案
rand.Next方法中的两个参数yuo使用的是指定要返回的最小和最大随机数-因此,如果需要从123开始编号,然后使用
the two parameters in the rand.Next method yuo are using specify the minumum and maximum random numbers to be returned - so if you need a number from 123 up, then use
numIterations = rand.next(123, 999);
它将提供一个介于123和999之间的随机数
which will provide a random number between 123 and 999
这篇关于如何从123开始产生否的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文