📄 editpwd.vb
字号:
Public Class EditPwd
Inherits System.Windows.Forms.Form
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
End Sub
'窗体重写 dispose 以清理组件列表。
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改此过程。
'不要使用代码编辑器修改它。
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents TextBoxOld As System.Windows.Forms.TextBox
Friend WithEvents TextBoxNew1 As System.Windows.Forms.TextBox
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents TextBoxNew2 As System.Windows.Forms.TextBox
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents ButtonEdit As System.Windows.Forms.Button
Friend WithEvents ButtonClose As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label
Me.TextBoxOld = New System.Windows.Forms.TextBox
Me.TextBoxNew1 = New System.Windows.Forms.TextBox
Me.Label2 = New System.Windows.Forms.Label
Me.TextBoxNew2 = New System.Windows.Forms.TextBox
Me.Label3 = New System.Windows.Forms.Label
Me.ButtonEdit = New System.Windows.Forms.Button
Me.ButtonClose = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(56, 8)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(56, 20)
Me.Label1.TabIndex = 0
Me.Label1.Text = "旧密码:"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'TextBoxOld
'
Me.TextBoxOld.Location = New System.Drawing.Point(112, 8)
Me.TextBoxOld.Name = "TextBoxOld"
Me.TextBoxOld.PasswordChar = Microsoft.VisualBasic.ChrW(42)
Me.TextBoxOld.Size = New System.Drawing.Size(128, 21)
Me.TextBoxOld.TabIndex = 1
Me.TextBoxOld.Text = ""
'
'TextBoxNew1
'
Me.TextBoxNew1.Location = New System.Drawing.Point(112, 40)
Me.TextBoxNew1.Name = "TextBoxNew1"
Me.TextBoxNew1.PasswordChar = Microsoft.VisualBasic.ChrW(42)
Me.TextBoxNew1.Size = New System.Drawing.Size(128, 21)
Me.TextBoxNew1.TabIndex = 3
Me.TextBoxNew1.Text = ""
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(56, 40)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(56, 20)
Me.Label2.TabIndex = 2
Me.Label2.Text = "新密码:"
Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'TextBoxNew2
'
Me.TextBoxNew2.Location = New System.Drawing.Point(112, 72)
Me.TextBoxNew2.Name = "TextBoxNew2"
Me.TextBoxNew2.PasswordChar = Microsoft.VisualBasic.ChrW(42)
Me.TextBoxNew2.Size = New System.Drawing.Size(128, 21)
Me.TextBoxNew2.TabIndex = 5
Me.TextBoxNew2.Text = ""
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(32, 72)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(80, 20)
Me.Label3.TabIndex = 4
Me.Label3.Text = "确认新密码:"
Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'ButtonEdit
'
Me.ButtonEdit.FlatStyle = System.Windows.Forms.FlatStyle.System
Me.ButtonEdit.Location = New System.Drawing.Point(80, 112)
Me.ButtonEdit.Name = "ButtonEdit"
Me.ButtonEdit.Size = New System.Drawing.Size(64, 23)
Me.ButtonEdit.TabIndex = 6
Me.ButtonEdit.Text = "修改"
'
'ButtonClose
'
Me.ButtonClose.FlatStyle = System.Windows.Forms.FlatStyle.System
Me.ButtonClose.Location = New System.Drawing.Point(168, 112)
Me.ButtonClose.Name = "ButtonClose"
Me.ButtonClose.Size = New System.Drawing.Size(64, 23)
Me.ButtonClose.TabIndex = 7
Me.ButtonClose.Text = "返回"
'
'EditPwd
'
Me.AutoScale = False
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(296, 149)
Me.ControlBox = False
Me.Controls.Add(Me.ButtonClose)
Me.Controls.Add(Me.ButtonEdit)
Me.Controls.Add(Me.TextBoxNew2)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.TextBoxNew1)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.TextBoxOld)
Me.Controls.Add(Me.Label1)
Me.MaximizeBox = False
Me.MaximumSize = New System.Drawing.Size(304, 183)
Me.MinimizeBox = False
Me.MinimumSize = New System.Drawing.Size(304, 183)
Me.Name = "EditPwd"
Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "小鱼流水帐 V1.0—修改密码"
Me.ResumeLayout(False)
End Sub
#End Region
'关闭窗体
Private Sub ButtonClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonClose.Click
Me.Close()
End Sub
'修改密码
Private Sub ButtonEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonEdit.Click
If Me.TextBoxOld.Text <> AdminPwd Then
MsgBox("你输入的旧密码不正确!", MsgBoxStyle.Exclamation)
ElseIf Me.TextBoxNew1.Text <> Me.TextBoxNew2.Text Then
MsgBox("两次输入的新密码不一致!", MsgBoxStyle.Exclamation)
ElseIf Me.TextBoxNew1.Text = Nothing Then
MsgBox("密码不能为空,请输入密码!", MsgBoxStyle.Exclamation)
Else
With New D_AdminInfo
Dim S As New S_AdminInfo
S.LoginName = AdminName
S.LoginPwd = Me.TextBoxNew2.Text
Dim Dtemp As Boolean
Dtemp = .EditPwd(S, ErrStr)
If Dtemp = True Then
MsgBox("密码修改成功!")
Me.Close()
Else
MsgBox("密码修改失败!")
Me.Close()
End If
End With
End If
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -