當前位置:編程學習大全網 - 源碼下載 - vb 雙色球 隨機 選號

vb 雙色球 隨機 選號

Private Sub Command1_Click()

Dim strTem As String

Dim intTem As Integer

Dim sName() As String

Dim i As Integer

Dim j As Integer

Dim iTemp As Integer

Dim aa As Integer

Do

Randomize

intTem = Int(Rnd * (14 - 1)) + 1

If InStr(1, strTem, CStr(intTem)) = 0 Then

strTem = strTem + CStr(intTem) + "."

i = i + 1

If i > 5 Then Exit Do

End If

Loop

sName = Split(strTem, ".")

For i = 0 To UBound(sName) - 2

For j = i + 1 To UBound(sName) - 1

If Val(sName(i)) > Val(sName(j)) Then

iTemp = sName(i)

sName(i) = sName(j)

sName(j) = iTemp

End If

Next

Next

For i = 0 To UBound(sName()) - 1

Text1(i).Text = Format(sName(i), "00")

Next

Text2.Text = Format(Int(Rnd * (17 - 1)) + 1, "00")

aa = Val(Text1(0).Text) + _

Val(Text1(1).Text) + _

Val(Text1(2).Text) + _

Val(Text1(3).Text) + _

Val(Text1(4).Text) + _

Val(Text1(5).Text)

'If aa >= 90 And aa <= 100 Then

Open "C:\Sample.txt" For Append As #1

Print #1, Text1(0).Text & " " & Text1(1).Text & " " & Text1(2).Text & " " & Text1(3).Text & " " & Text1(4).Text & " " & Text1(5).Text & " " & Text2.Text & vbCrLf

Close #1

'End If

End Sub

  • 上一篇:正在建設150噸石灰窯。想了解各個行業對石灰的質量要求?
  • 下一篇:Pulsar 的消息存儲機制和 Bookie 的 GC 機制原理
  • copyright 2024編程學習大全網