📄 frm_login.frm
字号:
VERSION 5.00
Begin VB.Form frm_login
BackColor = &H00C0C0FF&
BorderStyle = 1 'Fixed Single
Caption = "教务管理系统V1.0——登陆界面"
ClientHeight = 2895
ClientLeft = 4620
ClientTop = 2265
ClientWidth = 4680
ControlBox = 0 'False
ForeColor = &H8000000B&
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Moveable = 0 'False
ScaleHeight = 2895
ScaleWidth = 4680
StartUpPosition = 1 '所有者中心
Begin VB.TextBox Text2
Height = 375
IMEMode = 3 'DISABLE
Left = 2280
PasswordChar = "*"
TabIndex = 1
Top = 1200
Width = 1815
End
Begin VB.CommandButton Command1
Caption = "确 定"
Default = -1 'True
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 360
TabIndex = 2
Top = 2040
Width = 1455
End
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "取 消"
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2640
TabIndex = 3
Top = 2040
Width = 1455
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "Times New Roman"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 405
IMEMode = 3 'DISABLE
Left = 2280
TabIndex = 0
Top = 360
Width = 1815
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "输入密码:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 285
Left = 360
TabIndex = 5
Top = 1200
Width = 1575
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "输入用户名:"
BeginProperty Font
Name = "楷体_GB2312"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 285
Left = 360
TabIndex = 4
Top = 360
Width = 1890
End
End
Attribute VB_Name = "frm_login"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As Database
Dim rs As Recordset
Dim sql As String
Dim i As Integer
Private Sub Command1_Click()
i = i + 1
If i = 3 Then
MsgBox "很抱歉,您已经三次输入错误,为了系统的安全,您将不能进入系统!", 0 + 64 + 0 + 0, "系统提示信息"
Text1.Enabled = False
Text2.Enabled = False
Command1.Enabled = False
Else
Set db = OpenDatabase(App.Path + "\db\teaching_manage.mdb")
Set rs = db.OpenRecordset("select users_info.id from users_info where users_info.id='" & Text1.Text & "'")
If rs.EOF Or rs.BOF Then
MsgBox "没有此用户名,请检查您的输入是否正确!", 0 + 64 + 0 + 0, "系统提示信息"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Else
Set rs = db.OpenRecordset("select users_info.id from users_info where users_info.id='" & Text1.Text & "'and users_info.password='" & Text2.Text & "'")
If rs.EOF Or rs.BOF Then
MsgBox "密码错误,请检查输入是否正确!", 0 + 64 + 0 + 0, "系统提示信息"
Text2.Text = ""
Text2.SetFocus
Else
Userid = Text1.Text
frm_welcome.Show
Unload Me
End If
End If
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Activate()
Text1.SetFocus
End Sub
Private Sub Form_Load()
i = 0
Text1.Text = ""
Text2.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -