📄 frm_login.frm
字号:
VERSION 5.00
Object = "{2B12169D-6738-11D2-BF5B-00A024982E5B}#31.8#0"; "CoolButton.OCX"
Begin VB.Form frm_login
BackColor = &H00FFC0C0&
BorderStyle = 1 'Fixed Single
Caption = "GPRS用电管理系统"
ClientHeight = 2430
ClientLeft = 45
ClientTop = 435
ClientWidth = 3945
Icon = "frm_login.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2430
ScaleWidth = 3945
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Height = 2535
Left = 0
TabIndex = 0
Top = -80
Width = 3975
Begin VB.ComboBox Combo1
Height = 300
Left = 1440
TabIndex = 6
Text = "administrator"
Top = 480
Width = 2055
End
Begin TButton.axButton xpcmdbutton2
Height = 375
Left = 2520
TabIndex = 5
Top = 1800
Width = 1095
_ExtentX = 1931
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "退 出"
MaskColor = -2147483633
End
Begin TButton.axButton xpcmdbutton1
Height = 375
Left = 600
TabIndex = 4
Top = 1800
Width = 1095
_ExtentX = 1931
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "登 录"
MaskColor = -2147483633
End
Begin VB.TextBox txt_pw
Appearance = 0 'Flat
Height = 270
IMEMode = 3 'DISABLE
Left = 1440
PasswordChar = "*"
TabIndex = 3
Top = 1080
Width = 2055
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "密码:"
Height = 255
Left = 360
TabIndex = 2
Top = 1080
Width = 735
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "用户名:"
Height = 255
Left = 360
TabIndex = 1
Top = 600
Width = 855
End
End
End
Attribute VB_Name = "frm_login"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_Load()
Dim strsql As String
OpenCn
strsql = "select * from login "
openrs strsql
If rs.BOF Or rs.EOF Then
clors
Exit Sub
End If
While Not rs.EOF
Combo1.AddItem rs.Fields("user_name").Value
rs.MoveNext
Wend
clors
End Sub
Private Sub xpcmdbutton1_Click()
Dim strsql As String
If Trim(Combo1.Text) = "" Then
MsgBox ("用户名不能为空!"), vbOKOnly + vbInformation, "提示"
Exit Sub
End If
If Trim(txt_pw.Text) = "" Then
MsgBox ("用密码不能为空!"), vbOKOnly + vbInformation, "提示"
Exit Sub
End If
strsql = "select * from login where user_name = '" & Trim(Combo1.Text) & "'"
openrs strsql
If rs.BOF Or rs.EOF Then
MsgBox ("不存在该用户,请仔细检查您的输入!"), vbOKOnly + vbCritical, "错误"
clors
Exit Sub
End If
If rs.Fields("user_pw").Value <> Trim(txt_pw.Text) Then
MsgBox ("密码错误请仔细检查您的输入!"), vbOKOnly + vbCritical, "错误"
clors
Exit Sub
End If
usergrade = rs.Fields("user_grade").Value
clors
frm_main.Show
Unload Me
End Sub
Private Sub xpcmdbutton2_Click() '退出
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -