📄 用户登陆.frm
字号:
VERSION 5.00
Begin VB.Form 用户登陆
Caption = "用户登陆"
ClientHeight = 5700
ClientLeft = 3060
ClientTop = 3135
ClientWidth = 7605
LinkTopic = "Form2"
ScaleHeight = 5700
ScaleWidth = 7605
Begin VB.CommandButton Exit
BackColor = &H00FFC0C0&
Caption = "退出"
Height = 495
Left = 5880
MaskColor = &H00FFC0C0&
TabIndex = 9
Top = 4440
Width = 1335
End
Begin VB.CommandButton Enter
BackColor = &H00FFC0C0&
Caption = "进入"
DisabledPicture = "用户登陆.frx":0000
Enabled = 0 'False
Height = 495
Left = 5880
TabIndex = 8
Top = 3600
Width = 1335
End
Begin VB.CommandButton Load
BackColor = &H0000FF00&
Caption = "登陆"
DownPicture = "用户登陆.frx":0474
Height = 495
Left = 5880
MaskColor = &H0000FF00&
TabIndex = 7
Top = 2640
Width = 1335
End
Begin VB.ComboBox Combo_Admin_type
BackColor = &H00FF00FF&
Height = 300
ItemData = "用户登陆.frx":08E8
Left = 2280
List = "用户登陆.frx":08F2
TabIndex = 6
Text = "超级管理员"
Top = 4560
Width = 1935
End
Begin VB.TextBox Tpassword
BackColor = &H00FF00FF&
Height = 375
IMEMode = 3 'DISABLE
Left = 2280
PasswordChar = "*"
TabIndex = 5
Text = "040808"
Top = 3600
Width = 1935
End
Begin VB.TextBox TAdminID
BackColor = &H00FF00FF&
Height = 375
Left = 2280
TabIndex = 4
Text = "mafei"
Top = 2640
Width = 1935
End
Begin VB.Label LAdmin_type
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "管理员等级"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000080FF&
Height = 375
Left = 480
TabIndex = 3
Top = 4560
Width = 1455
End
Begin VB.Label Password
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "密码"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000080FF&
Height = 375
Left = 480
TabIndex = 2
Top = 3600
Width = 735
End
Begin VB.Label AdminID
BackColor = &H00FFC0C0&
BackStyle = 0 'Transparent
Caption = "ID"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000080FF&
Height = 375
Left = 480
TabIndex = 1
Top = 2640
Width = 1215
End
Begin VB.Label Label1
BackColor = &H00FFC0C0&
Caption = " 欢迎进入音像租赁系统"
BeginProperty Font
Name = "隶书"
Size = 26.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 495
Left = 720
TabIndex = 0
Top = 600
Width = 6135
End
Begin VB.Image Image1
Height = 5700
Left = 0
Picture = "用户登陆.frx":090E
Top = 0
Width = 7560
End
End
Attribute VB_Name = "用户登陆"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private cnRecordSet As ADODB.Recordset
''作为这个窗体中处理sql返回记录集使用
Private Sub Exit_Click()
End
End Sub
Private Sub Load_Click()
Dim sql As String
sql = "select AdminID ,Admin_Password from Admin_Info where AdminID = " + "'" + TAdminID.Text + "'" ''判断是否存在输入的用户
Set cnRecordSet = Form1.cnTest.Execute(sql)
If cnRecordSet.EOF = True Then ''如果不存在用户,则没有记录
MsgBox "用户名不存在!", 0 + vbInformation, "Warning"
TAdminID.Text = ""
Tpassword.Text = ""
Exit Sub
End If
''''''如果存在输入的用户,判断密码是否正确
sql = sql + "and Admin_Password = " + " '" + Tpassword.Text + "'"
Set cnRecordSet = Form1.cnTest.Execute(sql)
If cnRecordSet.EOF = True Then
MsgBox "密码错误!", 0 + vbInformation, "Warning"
Tpassword.Text = ""
Exit Sub
End If
sql = sql + "and Admin_type = " + "'" + Combo_Admin_type.Text + "'"
Set cnRecordSet = Form1.cnTest.Execute(sql)
If cnRecordSet.EOF = True Then
MsgBox "管理员类型错误!", 0 + vbInformation, "Warning"
Combo_Admin_type.Text = ""
Exit Sub
End If
Form1.Admin_type = Combo_Admin_type
Form1.AdminID = TAdminID.Text
Form1.Max_days = 30
Form1.Borrow_money = 2
MsgBox "登陆成功,合法用户!", 0 + vbInformation, "Welcome"
TAdminID.Enabled = False
Tpassword.Enabled = False
Enter.Enabled = True
End Sub
Private Sub Enter_Click()
Unload 用户登陆
音像租赁系统.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -