using System.Windows; namespace GroupLine.App { /// /// App.xaml 的交互逻辑 /// public partial class App : Application { private static System.Threading.Mutex mutex; protected override void OnStartup(StartupEventArgs e) { mutex = new System.Threading.Mutex(true, "OnlyRun_CRNS"); if (mutex.WaitOne(0, false)) { base.OnStartup(e); } else { MessageBox.Show("程序已经在运行!", "提示"); this.Shutdown(); } } } }