private void Enter_Click(object sender, RoutedEventArgs e) { if (Password.Password == "") { System.Windows.MessageBox.Show("Please enter a password"); } else if (choose == 0) { FileCryptoTool cryptoTool = new FileCryptoTool(); System.Windows.MessageBox.Show(cryptoTool.encrypt(pathFile, pathFolder, Password.Password)); } else { FileCryptoTool cryptoTool = new FileCryptoTool(); System.Windows.MessageBox.Show(cryptoTool.decrypt(pathFile, pathFolder, Password.Password)); } Password.Password = ""; }
/// <summary> /// Encrypt file by password. /// </summary> /// <param name="filePath"></param> /// <param name="destinationPath"></param> /// <param name="password"></param> /// <returns></returns> public string encrypt(string filePath, string destinationPath, string password) { writeToLog("User accessed Encryption Tool", currUser.userName, null); return(fileCryptoTool.encrypt(filePath, destinationPath, password)); }