?? frmmodpwd.vb
字號(hào):
Public Class FrmModPwd
Inherits System.Windows.Forms.Form
#Region " Windows 窗體設(shè)計(jì)器生成的代碼 "
Public Sub New()
MyBase.New()
'該調(diào)用是 Windows 窗體設(shè)計(jì)器所必需的。
InitializeComponent()
'在 InitializeComponent() 調(diào)用之后添加任何初始化
End Sub
'窗體重寫(xiě)處置以清理組件列表。
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 窗體設(shè)計(jì)器所必需的
Private components As System.ComponentModel.IContainer
'注意:以下過(guò)程是 Windows 窗體設(shè)計(jì)器所必需的
'可以使用 Windows 窗體設(shè)計(jì)器修改此過(guò)程。
'不要使用代碼編輯器修改它。
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents BtOK As System.Windows.Forms.Button
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents TxtConfirmPwd As System.Windows.Forms.TextBox
Friend WithEvents TxtNewPwd As System.Windows.Forms.TextBox
Friend WithEvents TxtOldPwd As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Button1 = New System.Windows.Forms.Button
Me.BtOK = New System.Windows.Forms.Button
Me.TxtConfirmPwd = New System.Windows.Forms.TextBox
Me.TxtNewPwd = New System.Windows.Forms.TextBox
Me.TxtOldPwd = New System.Windows.Forms.TextBox
Me.Label3 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.Label1 = New System.Windows.Forms.Label
Me.SuspendLayout()
'
'Button1
'
Me.Button1.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Button1.Location = New System.Drawing.Point(156, 154)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(80, 22)
Me.Button1.TabIndex = 15
Me.Button1.Text = "取消"
'
'BtOK
'
Me.BtOK.Location = New System.Drawing.Point(32, 154)
Me.BtOK.Name = "BtOK"
Me.BtOK.Size = New System.Drawing.Size(86, 22)
Me.BtOK.TabIndex = 14
Me.BtOK.Text = "確定"
'
'TxtConfirmPwd
'
Me.TxtConfirmPwd.BackColor = System.Drawing.Color.White
Me.TxtConfirmPwd.Location = New System.Drawing.Point(100, 108)
Me.TxtConfirmPwd.MaxLength = 10
Me.TxtConfirmPwd.Name = "TxtConfirmPwd"
Me.TxtConfirmPwd.PasswordChar = Global.Microsoft.VisualBasic.ChrW(42)
Me.TxtConfirmPwd.Size = New System.Drawing.Size(136, 21)
Me.TxtConfirmPwd.TabIndex = 13
'
'TxtNewPwd
'
Me.TxtNewPwd.BackColor = System.Drawing.Color.White
Me.TxtNewPwd.Location = New System.Drawing.Point(100, 64)
Me.TxtNewPwd.MaxLength = 10
Me.TxtNewPwd.Name = "TxtNewPwd"
Me.TxtNewPwd.PasswordChar = Global.Microsoft.VisualBasic.ChrW(42)
Me.TxtNewPwd.Size = New System.Drawing.Size(136, 21)
Me.TxtNewPwd.TabIndex = 12
'
'TxtOldPwd
'
Me.TxtOldPwd.BackColor = System.Drawing.Color.White
Me.TxtOldPwd.Location = New System.Drawing.Point(100, 20)
Me.TxtOldPwd.MaxLength = 10
Me.TxtOldPwd.Name = "TxtOldPwd"
Me.TxtOldPwd.PasswordChar = Global.Microsoft.VisualBasic.ChrW(42)
Me.TxtOldPwd.Size = New System.Drawing.Size(136, 21)
Me.TxtOldPwd.TabIndex = 11
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(14, 108)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(80, 21)
Me.Label3.TabIndex = 10
Me.Label3.Text = "確認(rèn)新密碼:"
Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(30, 64)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(64, 21)
Me.Label2.TabIndex = 9
Me.Label2.Text = "新密碼:"
Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(30, 20)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(64, 21)
Me.Label1.TabIndex = 8
Me.Label1.Text = "舊密碼:"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'FrmModPwd
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(258, 187)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.BtOK)
Me.Controls.Add(Me.TxtConfirmPwd)
Me.Controls.Add(Me.TxtNewPwd)
Me.Controls.Add(Me.TxtOldPwd)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "FrmModPwd"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "修改密碼"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
#End Region
Private Sub BtOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtOK.Click
If User.Password <> Trim(TxtOldPwd.Text) Then
'驗(yàn)證輸入的舊密碼是否正確
MsgBox("輸入的舊密碼不正確,請(qǐng)重新輸入!", MsgBoxStyle.Exclamation, "信息框")
TxtOldPwd.Focus()
TxtOldPwd.Text = ""
Exit Sub
End If
If Trim(TxtNewPwd.Text) = "" Then
MsgBox("輸入的新密碼不能為空!", MsgBoxStyle.Exclamation, "信息框")
Exit Sub
End If
If Trim(TxtConfirmPwd.Text) <> Trim(TxtNewPwd.Text) Then
'驗(yàn)證兩次輸入的密碼是否一致
MsgBox("兩次輸入的密碼不一致,請(qǐng)重試!", MsgBoxStyle.Exclamation)
TxtConfirmPwd.Focus()
TxtConfirmPwd.Text = ""
TxtNewPwd.Focus()
TxtNewPwd.Text = ""
Exit Sub
End If
User.PasswordModify(TxtNewPwd.Text)
MsgBox("恭喜你,密碼修改成功", , "信息框")
User.Password = Trim(TxtNewPwd.Text) '更新當(dāng)前系統(tǒng)記錄的密碼
Me.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
End Sub
End Class
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -