/// /// The primary entry point of the application. /// summary> [stathread] static void main () {// only one instance run // declares mutex. String info = "abcdefg"; <- The key is here, use it to identify if the program has run Mutex Mutex = New Mutex (false, info); // determine whether the mutex is used. Bool runexists =! Mutex.waitone (0, false); if (! Runexists) Application.run (New Form1 ()); Else MessageBox.show ("Application has started!");
}