Subscribing MessageBox to event

This commit is contained in:
2023-04-02 22:46:08 +02:00
parent ad88e3ebe1
commit c62e796589

View File

@@ -27,6 +27,7 @@ public partial class GeneratePassword : Form
{ {
try try
{ {
PasswordGenerator.ExceptionOccured += (e) => MessageBox.Show(e.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
string filePath = $"{currentPath}\\{passwordName.Text}"; string filePath = $"{currentPath}\\{passwordName.Text}";
File.WriteAllText( File.WriteAllText(
currentPath + $"\\{passwordName.Text}.gpg", currentPath + $"\\{passwordName.Text}.gpg",