📄 frmpass.frm
字号:
VERSION 5.00
Begin VB.Form frmPass
Caption = "图书馆管理系统"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 2 'CenterScreen
Begin VB.Frame Frame1
Caption = "用户登录"
Height = 1455
Left = 360
TabIndex = 2
Top = 840
Width = 3735
Begin VB.TextBox Text1
Height = 375
Index = 0
Left = 1080
TabIndex = 4
Top = 240
Width = 2055
End
Begin VB.TextBox Text1
Height = 375
IMEMode = 3 'DISABLE
Index = 1
Left = 1080
PasswordChar = "*"
TabIndex = 3
Top = 720
Width = 2055
End
Begin VB.Label Label2
Caption = "口 令"
Height = 375
Index = 1
Left = 360
TabIndex = 6
Top = 840
Width = 735
End
Begin VB.Label Label2
Caption = "用户名"
Height = 375
Index = 0
Left = 360
TabIndex = 5
Top = 360
Width = 735
End
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 495
Left = 480
TabIndex = 1
Top = 2400
Width = 1575
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 495
Left = 2400
TabIndex = 0
Top = 2400
Width = 1575
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "图书馆管理系统"
BeginProperty Font
Name = "黑体"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 0
TabIndex = 7
Top = 120
Width = 4575
End
End
Attribute VB_Name = "frmPass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public n As Integer
Private Sub Command1_Click()
Dim mrc As ADODB.Recordset
Dim txtsql As String
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
frmMain.Show '调用Main窗体
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
n = 0 'n保存登录的次数
End Sub
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = 13 And Index = 1 Then
Command1_Click
Else
Call endData(KeyAscii)
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -