//Button for Unlocking ---------------------------------------------------------------------------------------------
        private void btn_UnLock_Click(object sender, EventArgs e)
        {
            try
            {
                DataAccessClass dac = new DataAccessClass();
                Boolean         bl  = dac.PassKey(txt_Pass.Text);
                if (bl)
                {
                    DirectoryInfo d = new DirectoryInfo(fpath);
                    //string selectedpath = d.Parent.FullName + d.Name;
                    if (fpath.LastIndexOf(".{") == -1)
                    {
                        MessageBox.Show("Folder IS Already Unlocked", "NO NEED", MessageBoxButtons.OK);
                    }
                    else
                    {
                        d.MoveTo(fpath.Substring(0, fpath.LastIndexOf(".")));
                    }
                    //string filename = fpath.ToString();
                    //txtFilePath.Text = txtFilePath.Text.Substring(0, txtFilePath.Text.LastIndexOf("."));
                    pictureBox1.Image = Image.FromFile(Application.StartupPath + "\\unlock.jpg");

                    MessageBox.Show("Folder has been UnLocked!", "Congratulations!", MessageBoxButtons.OK);

                    string[] files = Directory.GetFiles(txt_FolderPath.Text, "*.*", SearchOption.AllDirectories);
                    //Console.WriteLine("The number of directories starting with p is {0}.", folders.Length);
                    MessageBox.Show("There Are " + files.Length + " files in the diretory....", "Nice!!", MessageBoxButtons.OK);
                    int count = 0;
                    foreach (string file in files)
                    {
                        LogicClass lgCs = new LogicClass();
                        Boolean    s    = lgCs.DecryptingMethod(file);
                        if (s)
                        {
                            count++;
                        }
                    }
                    if (count == files.Length)
                    {
                        MessageBox.Show(count + " Files Have been Unlocked!!", "Congratzz!!", MessageBoxButtons.OK);
                    }
                    else
                    {
                        MessageBox.Show("The Folder Has not Unlocked Properly!", "Error", MessageBoxButtons.OK);
                    }

                    DataAccessClass ndc = new DataAccessClass();
                    ndc.DeleteHighFolder(txt_FolderPath.Text);
                    txt_FolderPath.Clear();
                    txt_Pass.Clear();
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show("Invalid Input...", "Error!", MessageBoxButtons.OK);
            }
        }
        // To decrypt the file
        private void btn_unlock_click(object sender, EventArgs e)
        {
            try
            {
                DataAccessClass dac = new DataAccessClass();
                Boolean         s   = dac.PassKey(textBox_key.Text);
                if (s == true)
                {
                    LogicClass lc1  = new LogicClass();
                    Boolean    stat = lc1.DecryptingMethod(textBox_fLocation.Text, textBox_rKey.Text);
                    if (stat)
                    {
                        MessageBox.Show("Decryption Succesful!", "Decryption", MessageBoxButtons.OK);

                        dac.DeleteFileLockList(textBox_fLocation.Text);

                        dac.DeleteFileLockPassword(textBox_fLocation.Text);
                        MessageBox.Show("Data Inserted into Password Bank.", "DONE", MessageBoxButtons.OK);
                        textBox_fLocation.Clear();
                    }
                    else
                    {
                        MessageBox.Show("Decryption Error!", "Error", MessageBoxButtons.OK);
                    }
                }
                else
                {
                    MessageBox.Show("Wrong Password!", "Error", MessageBoxButtons.OK);
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK);
            }



            textBox_key.Clear();
            textBox_rKey.Clear();
        }
        //To Decrypt the File----------------------------------------------------------------
        private void button_LockEncr_Click(object sender, EventArgs e)
        {
            try
            {
                DataAccessClass dac = new DataAccessClass();
                Boolean         s   = dac.PassKey(textBox_uKey.Text);
                if (s == true)
                {
                    LogicClass lc1  = new LogicClass();
                    Boolean    stat = lc1.DecryptingMethod(textBox_newFileLoc.Text);
                    if (stat)
                    {
                        MessageBox.Show("Decryption Succesful!", "Decryption", MessageBoxButtons.OK);
                    }
                    else
                    {
                        MessageBox.Show("Decryption Error!", "Error", MessageBoxButtons.OK);
                    }
                }
                else
                {
                    MessageBox.Show("Wrong Password!", "Error", MessageBoxButtons.OK);
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show("Invalid Input", "Error", MessageBoxButtons.OK);
            }

            DataAccessClass dc = new DataAccessClass();

            dc.DeleteFileLockList(textBox_newFileLoc.Text);
            //textBox_encFileLoc.Clear();
            textBox_newFileLoc.Clear();
            textBox_uKey.Clear();
        }