📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form FrmLogin
Caption = "欢迎光临"
ClientHeight = 3300
ClientLeft = 60
ClientTop = 345
ClientWidth = 4710
Icon = "FrmLogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3300
ScaleWidth = 4710
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取消"
Height = 975
Left = 2640
Picture = "FrmLogin.frx":030A
Style = 1 'Graphical
TabIndex = 5
Top = 2040
Width = 1095
End
Begin VB.CommandButton Command1
Cancel = -1 'True
Caption = "登陆"
Height = 975
Left = 960
Picture = "FrmLogin.frx":074C
Style = 1 'Graphical
TabIndex = 4
Top = 2040
Width = 1095
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
BackColor = &H80000018&
Height = 270
IMEMode = 3 'DISABLE
Left = 2280
PasswordChar = "*"
TabIndex = 3
Top = 1560
Width = 2055
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
BackColor = &H80000018&
Height = 270
Left = 2280
TabIndex = 2
Top = 1080
Width = 2055
End
Begin VB.Label Label4
Caption = "初始密码:123"
Height = 255
Left = 2640
TabIndex = 7
Top = 600
Width = 1575
End
Begin VB.Label Label3
Caption = "初始用户:admi"
Height = 255
Left = 2640
TabIndex = 6
Top = 240
Width = 1575
End
Begin VB.Image Image1
Height = 600
Left = 480
Picture = "FrmLogin.frx":0A56
Top = 240
Width = 1830
End
Begin VB.Label Label2
Caption = "请输入密码"
ForeColor = &H8000000D&
Height = 255
Left = 480
TabIndex = 1
Top = 1620
Width = 1575
End
Begin VB.Label Label1
Caption = "用户名"
ForeColor = &H000000FF&
Height = 255
Left = 480
TabIndex = 0
Top = 1080
Width = 1575
End
End
Attribute VB_Name = "FrmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public bOK As Boolean
Private Sub Command1_Click()
Dim SQL As String
Dim rs As ADODB.Recordset
If Text1.Text = "" Then
MsgBox "你还没有输入你的用户名!", vbExclamation + vbOKOnly, "警告"
Exit Sub
End If
SQL = "SELECT 用户名,密码 FROM userInfo WHERE 用户名='" & Text1.Text & "'"
Set rs = ExecuteSQL(SQL)
If rs.EOF And rs.BOF Then
MsgBox "无此用户!", vbExclamation + vbOKOnly, "警告"
rs.Close
Set rs = Nothing
Exit Sub
Else
If Trim(rs.Fields("密码")) <> Trim(Text2.Text) Then
MsgBox "密码错误,请重试!", vbExclamation + vbOKOnly, "警告"
rs.Close
Set rs = Nothing
Exit Sub
Else
bOK = True
Unload Me
End If
End If
End Sub
Private Sub Command2_Click()
bOK = False
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -