日期:2014-05-18 浏览次数:21163 次
static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { try { const string mutextName = "wwwwwwwwhhhwlllllll77777777ll9999llllwwww"; Mutex m = new Mutex(true, mutextName); bool b = m.WaitOne(TimeSpan.Zero, true); MessageBox.Show(b.ToString()); m.ReleaseMutex(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } catch (Exception e) { MessageBox.Show(e.Message); } } }
Mutex m = new Mutex(true, mutextName);