📄 frmlogin.frm
字号:
VERSION 5.00
Object = "{1666F204-B71B-4E6D-AA21-DCE71B94F422}#7.0#0"; "SMARTXPBUTTON.OCX"
Begin VB.Form frmLogin
BorderStyle = 0 'None
Caption = "资料管理系统登录"
ClientHeight = 2160
ClientLeft = 0
ClientTop = 0
ClientWidth = 4170
FontTransparent = 0 'False
Icon = "frmLogin.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2160
ScaleWidth = 4170
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Tag = "登录"
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "Command2"
Height = 315
Left = 90
TabIndex = 8
Top = 2250
Width = 435
End
Begin VB.CommandButton Command1
Caption = "Command1"
Default = -1 'True
Height = 345
Left = 90
TabIndex = 7
Top = 2670
Width = 435
End
Begin SmartXpButton.SmartNetXpButton cmdCancel
Height = 345
Left = 2340
TabIndex = 6
Top = 1620
Width = 1155
_ExtentX = 2037
_ExtentY = 609
BackColorPop = 12640511
Caption = "取消(&C)"
CaptionBackColor= 14737632
EdgeColor = 12640511
RepeatDelay = 0
ShowCaption = -1 'True
ForeColor = 0
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
CaptionAreaPercent= 100
End
Begin SmartXpButton.SmartNetXpButton cmdOK
Height = 345
Left = 720
TabIndex = 5
Top = 1620
Width = 1155
_ExtentX = 2037
_ExtentY = 609
BackColorPop = 12640511
Caption = "确定(&O)"
CaptionBackColor= 14737632
EdgeColor = 12640511
RepeatDelay = 0
ShowCaption = -1 'True
ForeColor = 0
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
CaptionAreaPercent= 100
Hotkeys = "l"
End
Begin VB.ComboBox Combo1
Appearance = 0 'Flat
ForeColor = &H00000000&
Height = 300
Left = 1530
Style = 2 'Dropdown List
TabIndex = 2
Top = 720
Width = 2325
End
Begin VB.TextBox txtPassword
Appearance = 0 'Flat
Height = 300
IMEMode = 3 'DISABLE
Left = 1515
PasswordChar = "*"
TabIndex = 1
Top = 1170
Width = 2325
End
Begin VB.Shape Shape1
BorderColor = &H80000009&
FillColor = &H00C0C0C0&
FillStyle = 0 'Solid
Height = 375
Index = 3
Left = 2310
Top = 1590
Width = 1185
End
Begin VB.Shape Shape1
BorderColor = &H8000000E&
FillColor = &H00C0C0C0&
FillStyle = 0 'Solid
Height = 375
Index = 2
Left = 690
Top = 1590
Width = 1185
End
Begin VB.Shape Shape1
BorderColor = &H80000009&
FillStyle = 0 'Solid
Height = 405
Index = 1
Left = 2310
Top = 1590
Width = 1215
End
Begin VB.Shape Shape1
BorderColor = &H80000009&
FillStyle = 0 'Solid
Height = 405
Index = 0
Left = 690
Top = 1590
Width = 1215
End
Begin VB.Image imgTitleMinimize
Height = 210
Left = 2220
Picture = "frmLogin.frx":33D2
Stretch = -1 'True
Top = 2550
Width = 210
End
Begin VB.Image imgTitleClose
Height = 210
Left = 2265
Picture = "frmLogin.frx":361C
Stretch = -1 'True
Top = 2910
Width = 210
End
Begin VB.Image imgTitleHelp
Height = 210
Left = 2220
Picture = "frmLogin.frx":3866
Stretch = -1 'True
Top = 3270
Width = 210
End
Begin VB.Label lblTitle
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "资料管理系统登录"
BeginProperty Font
Name = "Arial"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 240
Left = 2550
TabIndex = 4
Top = 2610
Width = 1680
End
Begin VB.Image imgWindowBottomRight
Height = 450
Left = 1860
Picture = "frmLogin.frx":3AB0
Top = 2550
Width = 285
End
Begin VB.Image imgWindowBottomLeft
Height = 450
Left = 1500
Picture = "frmLogin.frx":41FA
Top = 2550
Width = 285
End
Begin VB.Image Imageicon
Height = 315
Left = 2895
Picture = "frmLogin.frx":4944
Stretch = -1 'True
Top = 3090
Width = 315
End
Begin VB.Image imgTitleMain
Height = 450
Left = 780
Picture = "frmLogin.frx":663E
Stretch = -1 'True
Top = 3000
Width = 285
End
Begin VB.Image imgWindowRight
Height = 450
Left = 1860
Picture = "frmLogin.frx":6D88
Stretch = -1 'True
Top = 3030
Width = 285
End
Begin VB.Image imgWindowLeft
Height = 450
Left = 1500
Picture = "frmLogin.frx":74D2
Stretch = -1 'True
Top = 3030
Width = 285
End
Begin VB.Image imgWindowBottom
Height = 450
Left = 1140
Picture = "frmLogin.frx":7C1C
Stretch = -1 'True
Top = 3030
Width = 285
End
Begin VB.Image imgTitleRight
Height = 450
Left = 1140
Picture = "frmLogin.frx":8366
Top = 2550
Width = 285
End
Begin VB.Image imgTitleLeft
Height = 450
Left = 780
Picture = "frmLogin.frx":8AB0
Top = 2550
Width = 285
End
Begin VB.Label lblLabels
BackColor = &H00CFCFCF&
Caption = "用户名(&U):"
Height = 255
Index = 0
Left = 315
TabIndex = 3
Tag = "用户名(&U):"
Top = 750
Width = 1080
End
Begin VB.Label lblLabels
BackColor = &H00CFCFCF&
Caption = "密 码(&P):"
Height = 255
Index = 1
Left = 315
TabIndex = 0
Tag = "密码(&P):"
Top = 1200
Width = 1080
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim l As Integer
Dim adoPrimaryRS As Recordset
Attribute adoPrimaryRS.VB_VarHelpID = -1
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_click()
adoPrimaryRS.AbsolutePosition = combo1.ListIndex + 1
u = adoPrimaryRS("user_id")
p = adoPrimaryRS("user_ps")
If combo1.Text = u And txtPassword.Text = p Then
gz_user = combo1.Text
Unload Me
frmSplash.Show
Else
l = l + 1
If l = 3 Then
Unload Me
Else
MsgBox "输入登录信息不正确,请从新输入!", vbExclamation
txtPassword.SetFocus
End If
End If
End Sub
Private Sub Command1_Click()
cmdOK_click
End Sub
Private Sub Command2_Click()
cmdCancel_Click
End Sub
Private Sub Form_Load()
On Error GoTo err_1
MakeWindow Me
l = 0
Dim db1 As Connection
Set db1 = New Connection
db1.CursorLocation = adUseClient
pt = fullpath("user.lbl")
mysql = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & pt
db1.Open mysql
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open "select * from user1", db1, adOpenStatic, adLockOptimistic
While Not adoPrimaryRS.EOF
u = adoPrimaryRS("user_id")
combo1.AddItem u
adoPrimaryRS.MoveNext
Wend
combo1.ListIndex = 0
Exit Sub
err_1:
MsgBox Err.Description, vbCritical
End Sub
Private Sub imgTitleClose_Click()
Unload Me
End Sub
Private Sub imgTitleLeft_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
DoDrag Me
End Sub
Private Sub imgTitleMain_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
DoDrag Me
End Sub
Private Sub imgTitleMinimize_Click()
Me.WindowState = 1
End Sub
Private Sub imgTitleRight_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
DoDrag Me
End Sub
Private Sub lblTitle_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
DoDrag Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -