📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "登录窗口"
ClientHeight = 3660
ClientLeft = 45
ClientTop = 435
ClientWidth = 6735
DrawWidth = 2
Icon = "frmLogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3660
ScaleWidth = 6735
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox Text1
BeginProperty Font
Name = "隶书"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2640
TabIndex = 0
Top = 1080
Width = 1935
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "隶书"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 2640
PasswordChar = "*"
TabIndex = 1
Top = 1800
Width = 1935
End
Begin VB.CommandButton Command1
Caption = "确 定"
Default = -1 'True
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 2160
TabIndex = 2
Top = 2760
Width = 1935
End
Begin VB.Frame Frame1
Height = 2535
Left = 0
TabIndex = 3
Top = 0
Width = 6735
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "请输入您的登录用户名和密码"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 1680
TabIndex = 7
Top = 480
Width = 2730
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "密 码:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 1440
TabIndex = 5
Top = 1920
Width = 840
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "用户名:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 1440
TabIndex = 4
Top = 1200
Width = 840
End
End
Begin VB.Frame Frame2
BorderStyle = 0 'None
DragIcon = "frmLogin.frx":0E42
Height = 1215
Left = 0
TabIndex = 6
Top = 2520
Width = 6735
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()
dbs.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbFile & ";Persist Security Info=False"
sqlstring = "select * from usemanage where username='" & Text1.Text & "' and password='" & Text2 & "'"
rst.Open sqlstring, dbs, adOpenDynamic, adLockOptimistic
If rst.BOF = False Then
UserRole = rst.Fields("role")
userid = rst.Fields(0)
MDIForm1.Show
Unload Me
Else
MsgBox "用户名或密码不正确,请重新输入!", 48, "信息提示"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End If
rst.Close
dbs.Close
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -