Files
csharpcode/patientman/PatientMan/Forms/frmChangePass.cs
2025-08-02 05:20:17 +07:00

44 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml;
namespace PatientMan.Forms
{
public partial class frmChangePass : PatientMan.BasicForms.frmCommon
{
public frmChangePass()
{
InitializeComponent();
}
private void Cancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void OK_Click(object sender, EventArgs e)
{
if ((this.Password.Text != this.RePassword.Text) || (this.Password.Text.Length==0) || (this.RePassword.Text.Length==0))
{
MessageBox.Show("The input values are not the same or empty","Change Password",MessageBoxButtons.OK);
}else
{
string savePassword= common.MD5Hash(Password.Text);
var doc = new XmlDocument();
string SettingsPath = Application.StartupPath + @"\Settings.fhi";
doc.Load(SettingsPath);
doc.GetElementsByTagName("Password")[0].InnerText = savePassword;
doc.Save(SettingsPath);
(new frmShowSaveInfo()).Show();
this.Close();
}
}
}
}