Programm message box

Wenn kein Dongle gefunden wurde, wird meldung angezeigt
This commit is contained in:
HuskyTeufel
2022-04-20 15:56:48 +02:00
parent a06a96f5fc
commit 2e00cfd1e9

View File

@@ -25,13 +25,13 @@ namespace SanSystem
Environment.Exit(1); Environment.Exit(1);
} }
#if !DEBUG #if !DEBUG
try
{
using (Dongle dongle = new Dongle(60)) using (Dongle dongle = new Dongle(60))
{ {
if (dongle.CheckDongleVorhanden()) if (dongle.CheckDongleVorhanden())
{ {
dongle.CleanDongle(); dongle.CleanDongle();
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmMain()); Application.Run(new frmMain());
@@ -42,6 +42,12 @@ namespace SanSystem
Application.Exit(); Application.Exit();
} }
} }
}
catch (Exception ex)
{
MessageBox.Show("Sorry es wurde kein Dongle gefunden!\n" + ex.Message);
Application.Exit();
}
#else #else
Application.EnableVisualStyles(); Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false); Application.SetCompatibleTextRenderingDefault(false);