Private Sub Timer1_Timer()
iSecond = iSecond + 1 '记时
End Sub
Private Sub 困难_Click() '随机产生33到126之间的字符
Label1.Caption = ""
Label2.Caption = ""
Label3.Caption = ""
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Randomize [n]
For i = 1 To 180
If i < 61 And i > 0 Then '在label1中产生字符
If i Mod 6 = 0 Then
sSource(i) = " "
Label1.Caption = Label1.Caption & " "
'每隔五个字母就自动产生一个空格
Else
sSource(i) = Chr(Int(Rnd() * 93 + 33))
Label1.Caption = Label1.Caption & sSource(i)
'随机产生33到126之间的字符
'并将其加入sSource字符数组中。
End If
End If
If i < 121 And i > 60 Then '在label2中产生字符
If i Mod 6 = 0 Then
sSource(i) = " "
Label2.Caption = Label2.Caption & " "
'每隔五个字母就自动产生一个空格
Else
sSource(i) = Chr(Int(Rnd() * 93 + 33))
Label2.Caption = Label2.Caption & sSource(i)
'随机产生33到126之间的字符母
'并将其加入sSource字符数组和中。
End If
End If
If i < 181 And i > 120 Then '在labe13中产生字符
If i Mod 6 = 0 Then
sSource(i) = " "
Label3.Caption = Label3.Caption & " "
'每隔五个字母就自动产生一个空格
Else
sSource(i) = Chr(Int(Rnd() * 93 + 33))
Label3.Caption = Label3.Caption & sSource(i)
'随机产生33到126之间的字符
'并将其加入sSource字符数组。
End If
End If
Next
Text7.Text = "困难"
Command1.Enabled = True
End Sub
Private Sub 容易_Click()
Label1.Caption = ""
Label2.Caption = ""
Label3.Caption = ""
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Randomize [n]
For i = 1 To 180
If i < 61 And i > 0 Then '在label1中产生字符
If i Mod 6 = 0 Then
sSource(i) = " "
Label1.Caption = Label1.Caption & " "
'每隔五个字母就自动产生一个空格
Else
sSource(i) = Chr(Int(Rnd() * 25 + 97))
Label1.Caption = Label1.Caption & sSource(i)
'随机产生97到122之间的字符
'并将其加入sSource字符数组。
End If
End If
If i < 121 And i > 60 Then '在label2中产生字符
If i Mod 6 = 0 Then
sSource(i) = " "
Label2.Caption = Label2.Caption & " "
'每隔五个字母就自动产生一个空格
Else
sSource(i) = Chr(Int(Rnd() * 25 + 97))
Label2.Caption = Label2.Caption & sSource(i)
'随机产生97到122之间的字符
'并将其加入sSource字符数组。
End If
End If
If i < 181 And i > 120 Then '在labe13中产生字符
If i Mod 6 = 0 Then
sSource(i) = " "
Label3.Caption = Label3.Caption & " "
'每隔五个字母就自动产生一个空格
Else
sSource(i) = Chr(Int(Rnd() * 25 + 97))
Label3.Caption = Label3.Caption & sSource(i)
'随机产生97到122之间的字符
'并将其加入sSource字符数组。
End If
End If
Next
Text7.Text = "容易"
Command1.Enabled = True
End Sub
Private Sub 中等难度_Click()
Label1.Caption = ""
Label2.Caption = ""
Label3.Caption = ""
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Randomize [n]