Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
// This will be set to true if this process can own the mutex.
bool pobjIOwnMutex = false;
// Try and get ownership of a mutex who's name is known.
System.Threading.Mutex pobjMutex = new System.Threading.Mutex(true, "MyMutex", out
pobjIOwnMutex);
// If the mutex is owned by this process, then run the application.
if (pobjIOwnMutex)
{
// Run the application.
Application.Run(new frmMain());
}
else
{
//exit application
}
private static Mutex s_Mutex;
static void Main()
{
s_Mutex = new Mutex(true, "PC Info");
if (s_Mutex.WaitOne(0,false))
{
Application.EnableVisualStyles();
Application.DoEvents();
Application.Run(new Hauptform());
}
}