Ejemplo n.º 1
0
        public static bool Login(LoginCredentials loginCredentials, Form form)
        {
            if (loginCredentials.IsValid())
            {
                // start notes page
                loggedUser.username = loginCredentials.username;
                loggedUser.password = loginCredentials.password;

                DirectoryInfo d     = new DirectoryInfo(Directory.GetCurrentDirectory() + "\\" + loginCredentials.Username);
                FileInfo[]    Files = d.GetFiles("*.aes");
                //Getting Text files
                foreach (FileInfo file in Files)
                {
                    string output = file.Name.Split('.')[0];
                    Encryption.FileDecrypt(
                        Directory.GetCurrentDirectory() + "\\" + loginCredentials.Username + "\\" + file.Name,
                        Directory.GetCurrentDirectory() + "\\" + loginCredentials.Username + "\\" + output + ".txt",
                        loginCredentials.password
                        );
                }

                form.Hide();
                var nt = new NotesForm();
                nt.ShowDialog();
                form.Close();
            }
            return(false);
        }
Ejemplo n.º 2
0
 public static bool Login(LoginCredentials loginCredentials, Form form)
 {
     if (loginCredentials.isValid())
     {
         // start notes page
         form.Hide();
         var nt = new NotesForm();
         nt.ShowDialog();
         form.Close();
         return(true);
     }
     return(false);
 }
Ejemplo n.º 3
0
        /// <summary>
        ///   <para>
        ///  Handles the Click event of the btnNotes control.  Launches the Notes form
        /// </para>
        /// </summary>
        private void btnNotes_Click(object sender, EventArgs e)
        {
            var m = new NotesForm(PersonKey);

            m.ShowDialog();
        }