RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
vb.net随机产生数字 vb随机数生成

VB.NET中怎么实现每单击一次按钮,文本框就多出现一个1-13的随机数字?

Dim n As Integer, b As Integer, a(13) As Integer

超过十载行业经验,技术领先,服务至上的经营模式,全靠网络和口碑获得客户,为自己降低成本,也就是为客户降低成本。到目前业务范围包括了:成都网站建设、成都网站设计,成都网站推广,成都网站优化,整体网络托管,小程序制作,微信开发,重庆APP开发,同时也可以让客户的网站和网络营销和我们一样获得订单和生意!

Private Sub Command1_Click()

If b 5 Then

b = b + 1

x = Int(n * Rnd()) + 1

Text1.Text = Text1.Text a(x) " "

a(x) = a(n)

n = n - 1

Else

Call Form_Load

End If

End Sub

Private Sub Form_Load()

Randomize

n = 13: b = 0

For i = 1 To 13

a(i) = i

Next i

Text1.Text = ""

End Sub

vb.net怎么随机生成5个不同是数(1-33内的数),大神求救

想要生成多少个都行。

Randomize()随机打乱

dim a1 as integer=cint(rnd()*32))+1

dim a2 as integer=cint(rnd()*32))+1

dim a3 as integer=cint(rnd()*32))+1

dim a4 as integer=cint(rnd()*32))+1

dim a5 as integer=cint(rnd()*32))+1

怎么用vb.net随机产生5个不同的数,范围1-33,求帮忙改一下

Private Sub Command1_Click()

Dim num(6) As Integer

Dim i As Integer, j As Integer

Dim tmp As Integer

Randomize '防止每次生出随机数一样

For i = 0 To 5

num(i) = Int(Rnd * 53) + 1

Next

PrintNum "新生成的6个随机数为:", num()

For i = 0 To 5

For j = 0 To 5

If num(j) num(j + 1) Then

tmp = num(j)

num(j) = num(j + 1)

num(j + 1) = tmp

End If

Next

Next

PrintNum "排序后的6个随机数为:", num()

End Sub


新闻名称:vb.net随机产生数字 vb随机数生成
文章路径:http://sczitong.cn/article/doheiei.html