初学VB编程1星期。 我想把登陆次数弄上去。怎么弄啊? 还有就是登陆次数到了一定的数量就不能登陆了。怎么弄啊??Private Sub Command1_Click()
Dim cs As String
cs = 0 to logintimes do
Const a = "chuans"
Const b = "5088047"
If Text1.Text = a And Text2.Text = b Then
MsgBox "登陆成功!!!^-^", 64
Else
cs = 1
MsgBox "密码错误!!!" & "登陆次数"& cs, 16
End If
End Sub
Dim cs As String
cs = 0 to logintimes do
Const a = "chuans"
Const b = "5088047"
If Text1.Text = a And Text2.Text = b Then
MsgBox "登陆成功!!!^-^", 64
Else
cs = 1
MsgBox "密码错误!!!" & "登陆次数"& cs, 16
End If
End Sub
解决方案 »
- 如何得到三维BYTE数组对应维的指针,并转换为long型?
- 如何取得已经注册控件的Licenses?
- listview如何实现这样的功能?
- 请教:VB中,实例化一个myForm as userform,然后再把这个myForm.Show,和不实例话直接 userform.show有什么区别吗?
- 为什么生成EXE文件后运行不正常,而在工程里F5运行是正常的?
- 大侠们救命!!急急急~~如何把listbox控件中的内容存入数据库相应的表格中?
- VB报错,大家有这种情况吗?
- 再送100分
- vsflexgrid滚动条问题
- 窗口的"所有者"与"父窗口"有何区别?
- 改成循环
- VB的MDI窗体中加入图片,如何铺满整个Image?
Dim counter As IntegerPrivate Sub Command1_Click()
If txtPassword <> "123456" Then
MsgBox "密码错误!!!" & "登陆次数" & counter + 1, 16
counter = counter + 1
End If
If counter = 3 Then
Unload Me
End If
End SubPrivate Sub Form_Load()
counter = 0
End Sub
Option Explicit
Private Sub Command1_Click()
Static counter As Integer
If txtPassword.Text <> "123456" Then
MsgBox "密码错误!!!" & "登陆次数" & counter + 1, 16
counter = counter + 1
End If
If counter = 3 Then
Unload Me
End If
End Sub