📄 frmpassword.frm
字号:
VERSION 5.00
Begin VB.Form FrmPassword
BorderStyle = 1 'Fixed Single
Caption = "修改密码"
ClientHeight = 2175
ClientLeft = 45
ClientTop = 330
ClientWidth = 4500
Icon = "FrmPassword.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2175
ScaleWidth = 4500
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton CmdCancel
Caption = "取消"
Height = 375
Left = 2400
TabIndex = 7
Top = 1560
Width = 1095
End
Begin VB.CommandButton CmdOk
Caption = "确定"
Height = 375
Left = 720
TabIndex = 6
Top = 1560
Width = 1095
End
Begin VB.TextBox TextVerify
Height = 375
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 3
Top = 1080
Width = 2535
End
Begin VB.TextBox TextNew
Height = 375
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 2
Top = 600
Width = 2535
End
Begin VB.TextBox TextOld
Height = 375
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 1
Top = 120
Width = 2535
End
Begin VB.Label Label3
Caption = "确认新密码"
Height = 255
Left = 240
TabIndex = 5
Top = 1200
Width = 975
End
Begin VB.Label Label2
Caption = "输入新密码"
Height = 255
Left = 240
TabIndex = 4
Top = 720
Width = 975
End
Begin VB.Label Label1
Caption = "输入原密码"
Height = 255
Left = 240
TabIndex = 0
Top = 240
Width = 975
End
End
Attribute VB_Name = "FrmPassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdCancel_Click()
Unload Me
Me.Hide
End Sub
Private Sub cmdOK_Click()
Dim strleft, strsingle, strencycoded As String
Dim intorigine, intencycoded As Integer
If Me.OldPassword = pwl Then
If Me.NewPassword = Me.VerifyPassword Then
pwl = Me.NewPassword
Xorpwl = ""
For i = 1 To Len(pwl)
strleft = Left(pwl, i)
strsingle = Right(strleft, 1)
intorigine = Asc(strsingle)
intencycoded = intorigine Xor 7
strencycoded = Chr(intencycoded)
Xorpwl = Xorpwl + strencycoded
Next
Open App.Path & "\" & "pwl.txt" For Output As #1
Write #1, Xorpwl
Close #1
Call ChangePassword
Unload Me
Me.Hide
Else
MsgBox "两次输入的密码不相同!"
End If
Else
MsgBox "密码不对!"
End If
End Sub
Public Property Get OldPassword() As String
OldPassword = Me.TextOld.Text
End Property
Public Property Let OldPassword(ByVal vNewValue As String)
Me.TextOld.Text = vNewValue
End Property
Public Property Get NewPassword() As String
NewPassword = Me.TextNew.Text
End Property
Public Property Let NewPassword(ByVal vNewValue As String)
Me.TextNew.Text = vNewValue
End Property
Public Property Get VerifyPassword() As String
VerifyPassword = Me.TextVerify.Text
End Property
Public Property Let VerifyPassword(ByVal vNewValue As String)
Me.TextVerify.Text = vNewValue
End Property
Public Sub ChangePassword()
MsgBox "密码已经被修改!"
End Sub
Private Sub Form_Load()
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -