📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form pass
Caption = "考务管理系统"
ClientHeight = 4185
ClientLeft = 60
ClientTop = 450
ClientWidth = 6165
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4185
ScaleWidth = 6165
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Caption = "用户登录"
Height = 2325
Left = 840
TabIndex = 2
Top = 660
Width = 4380
Begin VB.TextBox Text1
Height = 480
Index = 0
Left = 1410
TabIndex = 5
Tag = "0"
Top = 615
Width = 1995
End
Begin VB.TextBox Text1
Height = 480
IMEMode = 3 'DISABLE
Index = 1
Left = 1410
PasswordChar = "*"
TabIndex = 3
Tag = "1"
Top = 1410
Width = 1995
End
Begin VB.Label Label1
Caption = "用户名"
Height = 480
Left = 840
TabIndex = 6
Top = 735
Width = 960
End
Begin VB.Label Label2
Caption = "口令"
Height = 495
Left = 840
TabIndex = 4
Top = 1560
Width = 930
End
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 3810
TabIndex = 1
Top = 3105
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 495
Left = 1005
TabIndex = 0
Top = 3105
Width = 1215
End
End
Attribute VB_Name = "pass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim mrc As ADODB.Recordset
txtsql = "select * from oper where 用户名='" & Trim$(Text1(0).Text) _
& "'" & "And 口令 = '" & Trim$(Text1(1).Text) + "'"
Set mrc = exesql(txtsql)
If mrc.RecordCount = 0 Then '未找到该用户记录
n = n + 1
If n < 3 Then
MsgBox "没有这个用户,继续登录", vbOKOnly + vbExclamation, "信息提示"
Text1(0).Text = ""
Text1(1).Text = ""
Text1(0).SetFocus
Else
MsgBox "已经登录失败三次,退出系统", vbiokonly + vbExclamation, "信息提示"
mrc.Close
Unload Me
End If
Else '找到合法记录
userlevel = Trim(mrc.Fields("级别"))
mrc.Close
Unload Me
main.Show '调用main窗体
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub form_load()
n = 0 '保存登录的次数
End Sub
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
Call endata(KeyAscii)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -