📄 loginform.frm
字号:
VERSION 5.00
Begin VB.Form LoginForm
Caption = "用户登录框"
ClientHeight = 2490
ClientLeft = 60
ClientTop = 420
ClientWidth = 4680
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 2490
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.Frame loginDlg
Caption = "用户登录框"
Height = 2055
Left = 240
TabIndex = 0
Top = 240
Width = 4215
Begin VB.CommandButton LoginCancel
Caption = "Cancel"
Height = 375
Left = 3000
TabIndex = 6
Top = 1560
Width = 975
End
Begin VB.CommandButton LoginOk
Caption = "OK"
Height = 375
Left = 1680
TabIndex = 5
Top = 1560
Width = 975
End
Begin VB.TextBox txtLoginPwd
Height = 270
IMEMode = 3 'DISABLE
Left = 1200
PasswordChar = "*"
TabIndex = 4
Top = 840
Width = 2775
End
Begin VB.TextBox txtLoginName
Height = 270
Left = 1200
TabIndex = 3
Top = 360
Width = 2775
End
Begin VB.Label Label2
Caption = "密码:"
Height = 255
Left = 480
TabIndex = 2
Top = 840
Width = 855
End
Begin VB.Label Label1
Caption = "用户名:"
Height = 255
Index = 0
Left = 480
TabIndex = 1
Top = 360
Width = 855
End
End
End
Attribute VB_Name = "LoginForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub LoginCancel_Click()
Unload Me
End Sub
Private Sub LoginOk_Click()
'Dim mrc As ADODB.Recordset
strSql = "select * from user_info where user_info_name = '" & Trim(LoginForm.txtLoginName) & "' and user_info_pwd='" & Trim(LoginForm.txtLoginPwd) & "'"
Set rs = ExecuteSQL(strSql)
If rs.EOF = True Then
MsgBox "登录失败,用户名或密码错误!", vbExclamation + vbOKOnly, "警告"
rs.Close
Else
username = Trim(LoginForm.txtLoginName)
userpwd = Trim(LoginForm.txtLoginPwd)
MDIMainForm.Show
Unload Me
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -