添加项目文件。
This commit is contained in:
25
GroupLine.App/App.xaml.cs
Normal file
25
GroupLine.App/App.xaml.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace GroupLine.App
|
||||
{
|
||||
/// <summary>
|
||||
/// App.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user