📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmlogin
Caption = "欢迎使用枫林晚停车自动收费系统"
ClientHeight = 4185
ClientLeft = 4365
ClientTop = 4185
ClientWidth = 6405
LinkTopic = "Form1"
ScaleHeight = 4185
ScaleWidth = 6405
Begin VB.CommandButton Command2
Caption = "取消"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3960
TabIndex = 3
Top = 3240
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "登录"
DownPicture = "frmlogin.frx":0000
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1320
TabIndex = 2
Top = 3240
Width = 1335
End
Begin VB.TextBox Text2
Height = 495
IMEMode = 3 'DISABLE
Left = 2280
PasswordChar = "*"
TabIndex = 1
Top = 2040
Width = 3015
End
Begin VB.TextBox Text1
Height = 495
Left = 2280
TabIndex = 0
Top = 1080
Width = 3015
End
Begin VB.PictureBox Picture1
Height = 4215
Left = 0
Picture = "frmlogin.frx":18004E
ScaleHeight = 4155
ScaleWidth = 6435
TabIndex = 4
Top = 0
Width = 6495
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "密码:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1200
TabIndex = 6
Top = 2160
Width = 1095
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "用户名:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 720
TabIndex = 5
Top = 1200
Width = 1455
End
End
End
Attribute VB_Name = "frmlogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim check As New ADODB.Recordset
Dim dbstr As String
Dim userid As String
Dim userpwd As String
If Len(Trim(Me.Text1.Text)) <= 0 Then
MsgBox "用户名不能为空,请输入用户名!", , "登录提示"
Exit Sub
End If
If Len(Trim(Me.Text1.Text)) > 16 Then
MsgBox "输入的用户名不能大于16位", , "登录提示"
Exit Sub
End If
userid = Replace(Trim(Me.Text1.Text), "'", "'")
If Len(Trim(Me.Text2.Text)) <= 0 Then
MsgBox "请输入密码,密码不能为空", , "登录提示"
Exit Sub
End If
If Len(Trim(Me.Text2.Text)) > 16 Then
MsgBox "密码不能大于16位", , "登录提示"
Exit Sub
End If
userpwd = Trim(Me.Text2.Text)
dbstr = "select * from userinfo where userid='" & userid & "'"
check.Open dbstr, dbcnn, adOpenStatic, adLockReadOnly, -1
If check.RecordCount <= 0 Then
MsgBox "该用户名不存在,请从新输入", , "登录提示"
check.Close
Exit Sub
Else
check.MoveFirst
If Text2.Text = check.Fields("userpwd").Value Then '
usernow.id = Trim(Me.Text1.Text)
usernow.type = check.Fields("usertype").Value
Else
MsgBox "密码不正确!请输入正确的密码!", , "登录提示"
check.Close
Exit Sub
End If
check.Close
End If
Unload Me
frmmain.Show
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -