📄 loginsys.frm
字号:
VERSION 5.00
Begin VB.Form LoginSys
Caption = "登录"
ClientHeight = 4020
ClientLeft = 60
ClientTop = 345
ClientWidth = 5895
Icon = "LoginSys.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4020
ScaleWidth = 5895
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdOkCancel
Cancel = -1 'True
Caption = "取消(&C)"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 1
Left = 3120
Style = 1 'Graphical
TabIndex = 5
Top = 2760
Width = 855
End
Begin VB.CommandButton cmdOkCancel
Caption = "确定(&E)"
Default = -1 'True
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 0
Left = 1440
Style = 1 'Graphical
TabIndex = 4
Top = 2760
Width = 855
End
Begin VB.TextBox txtPass
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 2400
PasswordChar = "*"
TabIndex = 3
Text = "Text1"
Top = 2040
Width = 1815
End
Begin VB.ComboBox comPer
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 2400
TabIndex = 2
Text = "Combo1"
Top = 1320
Width = 1815
End
Begin VB.Label Label3
Caption = "图书管理信息系统"
BeginProperty Font
Name = "楷体_GB2312"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1080
TabIndex = 7
Top = 480
Width = 4095
End
Begin VB.Label Label2
Caption = "计科41班 蔡伶俐制作 欢迎使用!"
Height = 375
Left = 1440
TabIndex = 6
Top = 3480
Width = 2895
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H8000000A&
BackStyle = 0 'Transparent
Caption = "密 码"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Index = 1
Left = 1440
TabIndex = 1
Top = 2160
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H8000000A&
BackStyle = 0 'Transparent
Caption = "管理员"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 180
Index = 0
Left = 1440
TabIndex = 0
Top = 1440
Width = 540
End
End
Attribute VB_Name = "LoginSys"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Asc() As Integer
Dim db As Database
Dim rst As Recordset
Dim Rec As Integer
Private Sub cmdOkCancel_Click(Index As Integer)
Dim i As Integer
i = 0
Select Case Index
Case 0
If txtPass.Text = "" Or comPer.Text = "" Then
MsgBox "请选择用户名或输入密码!", 0 + 48, "提示"
txtPass.SetFocus
Exit Sub
End If
If Val(txtPass.Text) = Asc(comPer.ListIndex) Then
'MsgBox "正确"
Libadmin = comPer.Text
Mainfrm.Show
Unload Me
Else
MsgBox "密码错误,请重试!", 0 + 16, "错误"
txtPass.SetFocus
Exit Sub
End If
Case 1
Unload Me
End Select
End Sub
Private Sub Form_Load()
Dim i As Integer
Set db = Workspaces(0).OpenDatabase(App.Path & "\DataBase\BookMIS.mdb", False)
Set rst = db.OpenRecordset("Pass", dbOpenTable)
rst.MoveLast
Rec = rst.RecordCount
ReDim Asc(Rec - 1)
rst.MoveFirst
For i = 1 To Rec
comPer.AddItem rst.Fields("名称")
Asc(i - 1) = Val(rst.Fields("密码"))
rst.MoveNext
If rst.EOF Then Exit For
Next
comPer.Text = ""
txtPass.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -