📄 frmenter.frm
字号:
VERSION 5.00
Begin VB.Form frmEnter
BackColor = &H00C0FFC0&
Caption = "登陆系统"
ClientHeight = 2700
ClientLeft = 60
ClientTop = 345
ClientWidth = 4755
LinkTopic = "Form1"
ScaleHeight = 2700
ScaleWidth = 4755
StartUpPosition = 3 '窗口缺省
Begin VB.Data Data1
BackColor = &H0080C0FF&
Caption = "Data1"
Connect = "Access"
DatabaseName = " "
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
ForeColor = &H00FF0000&
Height = 375
Left = 1080
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "用户密码"
Top = 2160
Visible = 0 'False
Width = 3255
End
Begin VB.CommandButton Command3
BackColor = &H0000FFFF&
Height = 615
Left = 3960
Picture = "frmEnter.frx":0000
Style = 1 'Graphical
TabIndex = 6
ToolTipText = "退出系统"
Top = 1320
UseMaskColor = -1 'True
Width = 735
End
Begin VB.CommandButton Command2
BackColor = &H000000FF&
Height = 615
Left = 3000
Picture = "frmEnter.frx":0442
Style = 1 'Graphical
TabIndex = 5
ToolTipText = "更改密码"
Top = 1320
UseMaskColor = -1 'True
Width = 735
End
Begin VB.CommandButton Command1
BackColor = &H0000FF00&
Default = -1 'True
Height = 615
Left = 2040
Picture = "frmEnter.frx":0884
Style = 1 'Graphical
TabIndex = 4
ToolTipText = "登陆系统"
Top = 1320
Width = 735
End
Begin VB.Frame Frame1
BackColor = &H00C0FFC0&
Height = 1095
Left = 2040
TabIndex = 0
Top = 0
Width = 2535
Begin VB.TextBox Text2
DataField = "密码"
DataSource = "Data1"
Height = 270
Left = 1800
TabIndex = 10
Text = "Text2"
Top = 720
Visible = 0 'False
Width = 615
End
Begin VB.ComboBox Combo1
BackColor = &H00FFFFFF&
Height = 300
ItemData = "frmEnter.frx":0CC6
Left = 840
List = "frmEnter.frx":0CC8
TabIndex = 9
Text = "请选择管理员"
Top = 240
Width = 1575
End
Begin VB.TextBox Text1
Height = 270
IMEMode = 3 'DISABLE
Left = 840
MouseIcon = "frmEnter.frx":0CCA
MousePointer = 99 'Custom
PasswordChar = "*"
TabIndex = 3
Top = 720
Width = 1575
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "密码"
Height = 255
Left = 120
TabIndex = 2
Top = 720
Width = 615
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "管理员"
Height = 255
Left = 120
TabIndex = 1
Top = 360
Width = 735
End
End
Begin VB.Label Label5
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "教师管理系统"
BeginProperty Font
Name = "隶书"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C000C0&
Height = 375
Left = 0
TabIndex = 8
Top = 480
Width = 2055
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 735
Left = 120
TabIndex = 7
Top = 1320
Width = 1695
End
End
Attribute VB_Name = "frmEnter"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Change()
'Combo的改变引起的事件
Text1.Enabled = True
Text1.Text = ""
Command1.Enabled = True
Command2.Enabled = True
End Sub
Private Sub Combo1_DropDown()
Combo1.Text = ""
End Sub
Private Sub Command1_Click()
'使用户名和密码相对应
If Combo1.Text = "超级管理员" Then Data1.Recordset.FindFirst "用户名='超级管理员'"
If Combo1.Text = "001" Then
Data1.Recordset.FindFirst "用户名='001'"
frmMain.mnuChgPin.Visible = False
End If
If Combo1.Text = "002" Then
Data1.Recordset.FindFirst "用户名='002'"
frmMain.mnuChgPin.Visible = False
End If
If Combo1.Text = "003" Then
Data1.Recordset.FindFirst "用户名='003'"
frmMain.mnuChgPin.Visible = False
End If
If Combo1.Text = "004" Then
Data1.Recordset.FindFirst "用户名='004'"
frmMain.mnuChgPin.Visible = False
End If
If Combo1.Text = "005" Then
Data1.Recordset.FindFirst "用户名='005'"
frmMain.mnuChgPin.Visible = False
End If
'在登录的时候判断用户的正确性
If Text1.Text = Text2.Text Then
frmMain.Show
Text1.Text = ""
Unload Me
Else
MsgBox "密码错误,重新输入否?", vbCritical + vbOKOnly, "提示"
End If
End Sub
Private Sub Command2_Click()
'使得frmChange的数据和frmEnter同步
If Combo1.Text = "超级管理员" Then
Data1.Recordset.FindFirst "用户名='超级管理员'"
frmChange.Data1.Recordset.FindFirst "用户名='超级管理员'"
End If
If Combo1.Text = "001" Then
Data1.Recordset.FindFirst "用户名='001'"
frmChange.Data1.Recordset.FindFirst "用户名='001'"
End If
If Combo1.Text = "002" Then
Data1.Recordset.FindFirst "用户名='002'"
frmChange.Data1.Recordset.FindFirst "用户名='002'"
End If
If Combo1.Text = "003" Then
Data1.Recordset.FindFirst "用户名='003'"
frmChange.Data1.Recordset.FindFirst "用户名='003'"
End If
If Combo1.Text = "004" Then
Data1.Recordset.FindFirst "用户名='004'"
frmChange.Data1.Recordset.FindFirst "用户名='004'"
End If
If Combo1.Text = "005" Then
Data1.Recordset.FindFirst "用户名='005'"
frmChange.Data1.Recordset.FindFirst "用户名='005'"
End If
'在修改密码的时候判断用户的正确性
If Text1.Text <> "" Then
If Text1.Text = Text2.Text Then
frmChange.Show
Text1.Text = ""
Unload Me
Else: MsgBox "密码不正确!", vbOKOnly + vbExclamation, "提示"
End If
Else: MsgBox "请输入密码!", vbOKOnly + vbExclamation, "提示"
End If
End Sub
Private Sub Command3_Click()
'退出登录
End
End Sub
Private Sub Form_Load()
'初始化登录界面
Text1.Enabled = False
Command1.Enabled = False
Command2.Enabled = False
Data1.DatabaseName = App.Path + "\教师管理系统.mdb"
Label4.Caption = "请注意,管理员初始密码与编号相同,请在登陆后更改,以保证数据安全!"
With Combo1
.AddItem "超级管理员"
.AddItem "001"
.AddItem "002"
.AddItem "003"
.AddItem "004"
.AddItem "005"
End With
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -