mirror of
https://github.com/Crypto-Notepad/Crypto-Notepad.git
synced 2026-03-11 08:55:25 +00:00
Fixed bug with file saving on app closing
This commit is contained in:
parent
349dfbb853
commit
b8b3cccc13
1 changed files with 4 additions and 3 deletions
|
|
@ -786,9 +786,10 @@ private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
|
|||
trayIcon.Visible = false;
|
||||
using (StreamWriter writer = new StreamWriter(filePath))
|
||||
{
|
||||
string enc = "";
|
||||
Task.Run(async () => { enc = await AES.Encrypt(richTextBox.Text, PublicVar.encryptionKey.Get(), null, settings.HashAlgorithm, Convert.ToInt32(settings.PasswordIterations), Convert.ToInt32(settings.KeySize)); }).Wait();
|
||||
writer.Write(enc);
|
||||
string encryptedText = richTextBox.Text;
|
||||
Task.Run(async () => { encryptedText = await AES.Encrypt(encryptedText, PublicVar.encryptionKey.Get(), null, settings.HashAlgorithm,
|
||||
Convert.ToInt32(settings.PasswordIterations), Convert.ToInt32(settings.KeySize)); }).Wait();
|
||||
writer.Write(encryptedText);
|
||||
writer.Close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue