📄 frm_setlogin.frm
字号:
VERSION 5.00
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Object = "{2B12169D-6738-11D2-BF5B-00A024982E5B}#31.8#0"; "CoolButton.OCX"
Begin VB.Form frm_setlogin
BorderStyle = 1 'Fixed Single
Caption = "GPRS用电管理系统"
ClientHeight = 3270
ClientLeft = 45
ClientTop = 330
ClientWidth = 3615
Icon = "frm_setlogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3270
ScaleWidth = 3615
StartUpPosition = 1 '所有者中心
Begin TabDlg.SSTab SSTab1
Height = 3015
Left = 0
TabIndex = 0
Top = 240
Width = 3615
_ExtentX = 6376
_ExtentY = 5318
_Version = 393216
Style = 1
TabHeight = 520
TabCaption(0) = "添加用户"
TabPicture(0) = "frm_setlogin.frx":08CA
Tab(0).ControlEnabled= -1 'True
Tab(0).Control(0)= "Label2"
Tab(0).Control(0).Enabled= 0 'False
Tab(0).Control(1)= "Label3"
Tab(0).Control(1).Enabled= 0 'False
Tab(0).Control(2)= "Label4"
Tab(0).Control(2).Enabled= 0 'False
Tab(0).Control(3)= "axButton4"
Tab(0).Control(3).Enabled= 0 'False
Tab(0).Control(4)= "Option1"
Tab(0).Control(4).Enabled= 0 'False
Tab(0).Control(5)= "Option2"
Tab(0).Control(5).Enabled= 0 'False
Tab(0).Control(6)= "txt_name"
Tab(0).Control(6).Enabled= 0 'False
Tab(0).Control(7)= "txt_pw"
Tab(0).Control(7).Enabled= 0 'False
Tab(0).Control(8)= "axButton1"
Tab(0).Control(8).Enabled= 0 'False
Tab(0).ControlCount= 9
TabCaption(1) = "修改密码"
TabPicture(1) = "frm_setlogin.frx":08E6
Tab(1).ControlEnabled= 0 'False
Tab(1).Control(0)= "txt_newpw"
Tab(1).Control(1)= "axButton3"
Tab(1).Control(2)= "txt_pwupdata"
Tab(1).Control(3)= "txt_nameupdata"
Tab(1).Control(4)= "axButton2"
Tab(1).Control(5)= "Label8"
Tab(1).Control(6)= "Label6"
Tab(1).Control(7)= "Label5"
Tab(1).ControlCount= 8
TabCaption(2) = "删除用户"
TabPicture(2) = "frm_setlogin.frx":0902
Tab(2).ControlEnabled= 0 'False
Tab(2).Control(0)= "txt_namedel"
Tab(2).Control(1)= "axButton5"
Tab(2).Control(2)= "axButton6"
Tab(2).Control(3)= "Label9"
Tab(2).ControlCount= 4
Begin VB.TextBox txt_namedel
Height = 350
Left = -73920
TabIndex = 21
Top = 840
Width = 1815
End
Begin VB.TextBox txt_newpw
Height = 350
IMEMode = 3 'DISABLE
Left = -73680
MaxLength = 16
PasswordChar = "*"
TabIndex = 18
Top = 1680
Width = 1815
End
Begin TButton.axButton axButton1
Height = 375
Left = 480
TabIndex = 16
Top = 2400
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 axButton3
Height = 330
Left = -74640
TabIndex = 15
Top = 2280
Width = 1095
_ExtentX = 1931
_ExtentY = 582
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_pwupdata
Height = 350
IMEMode = 3 'DISABLE
Left = -73680
MaxLength = 16
PasswordChar = "*"
TabIndex = 12
Top = 1200
Width = 1815
End
Begin VB.TextBox txt_nameupdata
Height = 350
Left = -73680
MaxLength = 16
TabIndex = 11
Top = 720
Width = 1815
End
Begin VB.TextBox txt_pw
Height = 350
IMEMode = 3 'DISABLE
Left = 1200
MaxLength = 16
PasswordChar = "*"
TabIndex = 6
Top = 1200
Width = 1815
End
Begin VB.TextBox txt_name
Height = 350
Left = 1200
MaxLength = 16
TabIndex = 5
Top = 720
Width = 1815
End
Begin VB.OptionButton Option2
Caption = "操作员"
Height = 375
Left = 2160
TabIndex = 4
Top = 1680
Width = 975
End
Begin VB.OptionButton Option1
Caption = "管理员"
Height = 375
Left = 1200
TabIndex = 3
Top = 1680
Width = 1095
End
Begin TButton.axButton axButton4
Height = 375
Left = 1800
TabIndex = 2
Top = 2400
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 axButton2
Height = 330
Left = -73200
TabIndex = 10
Top = 2280
Width = 1095
_ExtentX = 1931
_ExtentY = 582
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 axButton5
Height = 375
Left = -74520
TabIndex = 19
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 axButton6
Height = 375
Left = -73200
TabIndex = 20
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.Label Label9
Caption = "用户名:"
Height = 255
Left = -74640
TabIndex = 22
Top = 960
Width = 735
End
Begin VB.Label Label8
Caption = "用户新密码:"
Height = 255
Left = -74760
TabIndex = 17
Top = 1800
Width = 1335
End
Begin VB.Label Label6
Caption = "用户旧密码:"
Height = 255
Left = -74760
TabIndex = 14
Top = 1320
Width = 1095
End
Begin VB.Label Label5
Caption = "用户名:"
Height = 255
Left = -74760
TabIndex = 13
Top = 840
Width = 735
End
Begin VB.Label Label4
Caption = "用户类别:"
Height = 375
Left = 240
TabIndex = 9
Top = 1800
Width = 975
End
Begin VB.Label Label3
Caption = "用户密码:"
Height = 255
Left = 240
TabIndex = 8
Top = 1320
Width = 855
End
Begin VB.Label Label2
Caption = "用户名:"
Height = 255
Left = 240
TabIndex = 7
Top = 840
Width = 735
End
End
Begin VB.Label Label1
Caption = "权限管理"
ForeColor = &H00FF0000&
Height = 375
Left = 0
TabIndex = 1
Top = 0
Width = 975
End
End
Attribute VB_Name = "frm_setlogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub axButton1_Click()
Dim strsql As String
If Trim(txt_name.Text) = "" Then
MsgBox ("用户名不能为空!"), vbOKOnly + vbInformation, "提示"
Exit Sub
End If
If Trim(txt_pw.Text) = "" Then
MsgBox ("用户密码不能为空"), vbOKOnly + vbInformation, ""
Exit Sub
End If
If Option1.Value = False And Option2.Value = False Then
MsgBox ("请选择用户权限!"), vbOKOnly + vbInformation, "提示"
Exit Sub
End If
strsql = "select * from login where user_name='" & Trim(txt_name.Text) & "'"
openrs strsql
If rs.BOF Or rs.EOF Then
rs.AddNew
rs.Fields("user_name").Value = Trim(txt_name.Text)
rs.Fields("user_pw").Value = Trim(txt_pw.Text)
If Option1.Value = True Then
rs.Fields("user_grade").Value = "1"
Else
rs.Fields("user_grade").Value = "2"
End If
rs.UpdateBatch
MsgBox ("添加成功!"), vbOKOnly + vbInformation, "提示"
Else
MsgBox ("已经存在该用户名,请你重新输入用户名!"), vbOKOnly + vbInformation, "提示"
End If
clors
End Sub
Private Sub axButton2_Click()
Unload Me
End Sub
Private Sub axButton3_Click()
Dim strsql As String
If Trim(txt_nameupdata.Text) = "" Then
MsgBox ("用户名不能为空!"), vbOKOnly + vbInformation, "提示"
Exit Sub
End If
If Trim(txt_pwupdata.Text) = "" Then
MsgBox ("用旧户密码不能为空"), vbOKOnly + vbInformation, ""
Exit Sub
End If
If Trim(txt_newpw.Text) = "" Then
MsgBox ("用户新密码不能为空"), vbOKOnly + vbInformation, ""
Exit Sub
End If
strsql = "select * from login where user_name='" & Trim(txt_nameupdata.Text) & "'"
openrs strsql
If rs.EOF Then
MsgBox ("不存在该用户!"), vbOKOnly + vbInformation, "提示"
Exit Sub
End If
If rs.Fields("user_pw").Value <> Trim(txt_pwupdata.Text) Then
MsgBox ("用户旧密码错误!"), vbOKOnly + vbInformation, "提示"
Exit Sub
End If
rs.Fields("user_pw").Value = Trim(txt_newpw.Text)
rs.UpdateBatch
clors
MsgBox ("用户密码修改成功!"), vbOKOnly + vbInformation, "提示"
End Sub
Private Sub axButton4_Click()
Unload Me
End Sub
Private Sub axButton5_Click()
Dim strsql As String
If Trim(txt_namedel.Text) = "" Then
MsgBox ("用户名不能为空!"), vbOKOnly + vbInformation, "提示"
Exit Sub
End If
strsql = "select * from login where user_name='" & Trim(txt_namedel.Text) & "'"
openrs strsql
If rs.EOF Then
MsgBox ("不存在该用户"), vbOKOnly + vbInformation, "提示"
Exit Sub
End If
rs.Delete
rs.UpdateBatch
MsgBox ("用户删除成功!"), vbOKOnly + vbInformation, "提示"
End Sub
Private Sub axButton6_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -