📄 setpassfrm.frm
字号:
VERSION 5.00
Begin VB.Form SetPass
BorderStyle = 1 'Fixed Single
Caption = "密码修改"
ClientHeight = 2955
ClientLeft = 45
ClientTop = 330
ClientWidth = 4050
Icon = "SetPassFrm.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2955
ScaleWidth = 4050
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Index = 2
Left = 1680
TabIndex = 11
Top = 1080
Width = 2295
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Index = 1
Left = 1680
PasswordChar = "*"
TabIndex = 9
Top = 600
Width = 2295
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Index = 0
Left = 1680
TabIndex = 8
Top = 120
Width = 2295
End
Begin VB.CommandButton Command1
Caption = "取 消"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 1
Left = 3000
TabIndex = 6
Top = 2520
Width = 975
End
Begin VB.CommandButton Command1
Caption = "确 定"
Default = -1 'True
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 0
Left = 2040
TabIndex = 5
Top = 2520
Width = 975
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Index = 4
Left = 1680
PasswordChar = "*"
TabIndex = 4
Top = 2040
Width = 2295
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Index = 3
Left = 1680
PasswordChar = "*"
TabIndex = 3
Top = 1560
Width = 2295
End
Begin VB.Label Label1
Caption = "新用户名:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 2
Left = 120
TabIndex = 10
Top = 1080
Width = 1455
End
Begin VB.Label Label1
Caption = "旧用户名:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 0
Left = 120
TabIndex = 7
Top = 120
Width = 1455
End
Begin VB.Label Label1
Caption = "确认密码:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 4
Left = 120
TabIndex = 2
Top = 2040
Width = 1455
End
Begin VB.Label Label1
Caption = "新 密 码:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 3
Left = 120
TabIndex = 1
Top = 1560
Width = 1455
End
Begin VB.Label Label1
Caption = "旧 密 码:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 1
Left = 120
TabIndex = 0
Top = 600
Width = 1455
End
End
Attribute VB_Name = "SetPass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click(Index As Integer)
Select Case Index
Case 0:
If GetString(HKEY_CURRENT_USER, LOGON_REG_PATH, "UserName") <> Text1(0).Text Then
MsgBox "无此用户!", , "密码设置..."
Exit Sub
End If
If GetString(HKEY_CURRENT_USER, LOGON_REG_PATH, "PassWord") <> Text1(1).Text Then
MsgBox "旧密码错误!", , "密码设置..."
Exit Sub
End If
If Text1(2).Text = "" Or Text1(3).Text = "" Or Text1(4).Text = "" Then
MsgBox "新用户名和密码不能为空!", vbOKOnly, "错误..."
Exit Sub
End If
If Text1(3).Text <> Text1(4).Text Then
MsgBox "新密码与确认码不一致!", , "密码设置..."
Exit Sub
End If
SaveString HKEY_CURRENT_USER, LOGON_REG_PATH, "UserName", Text1(2).Text
SaveString HKEY_CURRENT_USER, LOGON_REG_PATH, "PassWord", Text1(3).Text
Unload Me
Case 1:
Unload Me
End Select
End Sub
Private Sub Form_Load()
Me.Caption = App.ProductName & " <密码设置>"
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
Text1(0).Text = GetString(HKEY_CURRENT_USER, LOGON_REG_PATH, "UserName") '自动填入旧用户名。
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -