62 lines
2.7 KiB
VB.net
62 lines
2.7 KiB
VB.net
Imports System.Windows.Forms
|
|
|
|
Public Class frmPWChange
|
|
|
|
Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
|
|
If Me.txtPWNew.Text <> "" And txtPWNew_Best.Text <> "" Then
|
|
If Me.txtPWNew_Best.Text <> txtPWNew.Text Then
|
|
MsgBox("Die Neuen Passwörter stimmen nicht überein!", MsgBoxStyle.Critical, "Achtung:")
|
|
Me.txtPWNew.Text = ""
|
|
Me.txtPWNew_Best.Text = ""
|
|
Exit Sub
|
|
Else
|
|
If Me.txtPWOld.Text = My.Settings.vPW_Admin Then
|
|
Dim result As MsgBoxResult = MsgBox("Wollen sie das Admin-Passwort wirklich ändern?", MsgBoxStyle.YesNoCancel, "Bestätigung erforderlich!")
|
|
If result = MsgBoxResult.Yes Then
|
|
My.Settings.vPW_Admin = Me.txtPWNew.Text
|
|
My.Settings.Save()
|
|
Me.DialogResult = System.Windows.Forms.DialogResult.OK
|
|
Me.Close()
|
|
End If
|
|
Else
|
|
MsgBox("Sie haben das falsche Admin-Passwort eingegeben!", MsgBoxStyle.Critical, "Achtung:")
|
|
Me.txtPWOld.Text = ""
|
|
Exit Sub
|
|
End If
|
|
|
|
End If
|
|
Else
|
|
MsgBox("Bitte geben Sie Ihr Neues Passwort 2x ein!")
|
|
Exit Sub
|
|
End If
|
|
|
|
End Sub
|
|
|
|
Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
|
|
Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
|
|
Me.Close()
|
|
End Sub
|
|
|
|
Private Sub txtPWNew_Best_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtPWNew_Best.Leave
|
|
If Me.txtPWNew_Best.Text <> txtPWNew.Text Then
|
|
MsgBox("Die Neuen Passwörter stimmen nicht überein!", MsgBoxStyle.Critical, "Achtung:")
|
|
Me.txtPWNew.Text = ""
|
|
Me.txtPWNew_Best.Text = ""
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub frmPWChange_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
|
|
txtPWOld.Text = ""
|
|
txtPWNew.Text = ""
|
|
txtPWNew_Best.Text = ""
|
|
End Sub
|
|
|
|
Private Sub textbox_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtPWOld.GotFocus, txtPWNew.GotFocus, txtPWNew_Best.GotFocus
|
|
CType(sender, TextBox).BackColor = Color.Lime
|
|
End Sub
|
|
|
|
Private Sub textbox_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtPWOld.LostFocus, txtPWNew.LostFocus, txtPWNew_Best.LostFocus
|
|
CType(sender, TextBox).BackColor = Color.White
|
|
End Sub
|
|
End Class
|