60 lines
1.7 KiB
C#
60 lines
1.7 KiB
C#
#define LAPTOP
|
|
using SanShared;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
|
|
namespace SanSystem
|
|
{
|
|
static class Program
|
|
{
|
|
/// <summary>
|
|
/// Der Haupteinstiegspunkt für die Anwendung.
|
|
/// </summary>
|
|
[STAThread]
|
|
static void Main()
|
|
{
|
|
new Mutex(initiallyOwned: true, "SanVerwaltung", out bool result);
|
|
if(!result)
|
|
{
|
|
MessageBox.Show("Bitte nur 1 Instanz starten der Software!", "", MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
|
Environment.Exit(1);
|
|
}
|
|
//#if !DEBUG
|
|
try
|
|
{
|
|
using (Dongle dongle = new Dongle(60))
|
|
{
|
|
if (dongle.CheckDongleVorhanden())
|
|
{
|
|
dongle.CleanDongle();
|
|
Application.EnableVisualStyles();
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
Application.Run(new frmMain());
|
|
}
|
|
else
|
|
{
|
|
MessageBox.Show("Sorry es wurde kein Dongle gefunden!");
|
|
Application.Exit();
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show("Sorry es wurde kein Dongle gefunden!\n" + ex.Message);
|
|
Application.Exit();
|
|
}
|
|
/*#else
|
|
Application.EnableVisualStyles();
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
Application.Run(new frmMain());
|
|
#endif*/
|
|
}
|
|
|
|
}
|
|
}
|