📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
Caption = "登录"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取消"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2520
TabIndex = 6
Top = 2160
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "确定"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 600
TabIndex = 5
Top = 2160
Width = 1215
End
Begin VB.TextBox Text2
Height = 375
IMEMode = 3 'DISABLE
Left = 2040
PasswordChar = "*"
TabIndex = 4
Top = 1560
Width = 1695
End
Begin VB.TextBox Text1
Height = 375
Left = 2040
TabIndex = 3
Top = 960
Width = 1695
End
Begin VB.Label Label3
Caption = "用户密码"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 480
TabIndex = 2
Top = 1560
Width = 1335
End
Begin VB.Label Label2
Caption = "用户名"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 720
TabIndex = 1
Top = 1080
Width = 855
End
Begin VB.Label Label1
Caption = "企事业单位人员管理系统"
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 0
Top = 360
Width = 3975
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public OK As Boolean
Dim miCount As Integer
Dim UserName As String
Private Sub Command1_Click()
'用来存放SQL语句
Dim txtSQL As String
'用来存放记录集对象
Dim mrc As New ADODB.Recordset
'用来存放返回信息
Dim MsgText As String
UserName = ""
'判断输入用户名是否为空
If Trim(Text1.Text = "") Then
MsgBox "没有这个用户,请重新输入用户名!", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Else
'查询指定用户名记录
txtSQL = "select * from user_Info where user_ID='" & Text1.Text & "'"
'执行查询语句
Set mrc = ExecuteSQL(txtSQL, MsgText)
'mrc.Open
If mrc.EOF = True Then
MsgBox "没有这个用户,请重新输入用户名!", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Else
'判断输入密码是否正确
If Trim(mrc.Fields(1)) = Trim(Text2.Text) Then
Me.Hide
OK = True
mrc.Close
UserName = Trim(Text1.Text)
frmMain.Show
Else
MsgBox "输入密码不正确,请重新输入!", vbOKOnly + vbExclamation, "警告"
Text2.SetFocus
Text2.Text = ""
End If
End If
End If
'记载输入密码次数
miCount = miCount + 1
If miCount = 3 Then
Me.Hide
End If
Exit Sub
End Sub
Private Sub Command2_Click()
OK = False
Me.Hide
End Sub
Private Sub Form_Load()
OK = False
miCount = 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -