using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;

namespace video_club
{
    public partial class frmedituser : Form
    {
        public frmedituser()
        {
            InitializeComponent();
        }
        public byte[] GetMD5(string password)
        {
            byte[] HashedDataBytes = new byte[16];
            UTF8Encoding Encoder = new UTF8Encoding();
            MD5CryptoServiceProvider Md5Hasher = new MD5CryptoServiceProvider();
            HashedDataBytes = Md5Hasher.ComputeHash(Encoder.GetBytes(password));
            return HashedDataBytes;
        }
        private void buttonX1_Click(object sender, EventArgs e)
        {
          
            tblusersTableAdapter1.Fill(dataSet11.tblusers);
            if (textBoxX1.Text == Convert.ToString(GetMD5(dataSet11.tblusers.passColumn)) )

                if (textBoxX2.Text == textBoxX3.Text)
                {

                    MessageBox.Show("رمز با موفقیت تغییر یافت", "", MessageBoxButtons.OK);

                }
                else
                {
                    MessageBox.Show("تکرار رمز اشتباه است", "!!! اخطار", MessageBoxButtons.OK);

                }
            else
            {

                MessageBox.Show("salam", "!!! اخطار", MessageBoxButtons.OK);
            }
        }

        private object GetMD5(DataColumn dataColumn)
        {
            throw new NotImplementedException();
        }




        private void buttonX2_Click(object sender, EventArgs e)
        {
            this.Close();

        }

        private void clos()
        {
            throw new NotImplementedException();
        }

        private void frmedituser_Load(object sender, EventArgs e)
        {
         
        }
    }
}
