📄 pass.frm
字号:
VERSION 5.00
Begin VB.Form pass
Caption = "考务管理系统"
ClientHeight = 3435
ClientLeft = 60
ClientTop = 450
ClientWidth = 5115
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3435
ScaleWidth = 5115
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2640
TabIndex = 7
Top = 2640
Width = 735
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 1680
TabIndex = 6
Top = 2640
Width = 735
End
Begin VB.Frame Frame1
Caption = "用户登陆"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1455
Left = 960
TabIndex = 0
Top = 960
Width = 3255
Begin VB.TextBox Text1
Height = 270
IMEMode = 3 'DISABLE
Index = 1
Left = 1440
PasswordChar = "*"
TabIndex = 5
Top = 840
Width = 1215
End
Begin VB.TextBox Text1
Height = 270
Index = 0
Left = 1440
TabIndex = 4
Top = 480
Width = 1215
End
Begin VB.Label Label3
Caption = "口 令"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 600
TabIndex = 3
Top = 840
Width = 615
End
Begin VB.Label Label2
Caption = "用户名"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 600
TabIndex = 2
Top = 480
Width = 615
End
End
Begin VB.Label Label1
Caption = "考务管理系统"
BeginProperty Font
Name = "仿宋_GB2312"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1440
TabIndex = 1
Top = 360
Width = 2415
End
End
Attribute VB_Name = "pass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
n = 0 'n保存登陆的次数
End Sub
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 "已登陆失败三次,退出系统", vbOKOnly + 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 text1_KeyPress(Index As Integer, KeyAscii As Integer)
Call endata(KeyAscii)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -