30 lines
698 B
C#
30 lines
698 B
C#
|
using System.Configuration;
|
|||
|
using System.Data;
|
|||
|
using System.Runtime.InteropServices;
|
|||
|
using System.Windows;
|
|||
|
|
|||
|
namespace LiveTools
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// Interaction logic for App.xaml
|
|||
|
/// </summary>
|
|||
|
public partial class App : Application
|
|||
|
{
|
|||
|
private static Mutex mutex = null;
|
|||
|
protected override void OnStartup(StartupEventArgs e)
|
|||
|
{
|
|||
|
base.OnStartup(e);
|
|||
|
|
|||
|
bool isFirstInstance;
|
|||
|
mutex = new Mutex(true,Config.SoftId, out isFirstInstance);
|
|||
|
|
|||
|
if (!isFirstInstance)
|
|||
|
{
|
|||
|
//MessageBox.Show("应用程序已经在运行。");
|
|||
|
Current.Shutdown();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
}
|