20240301_JSEQ_upperpc/JiangsuEarthquakeNow/JiangsuEarthquake/App.xaml.cs

30 lines
714 B
C#
Raw Permalink Normal View History

using System.Configuration;
using System.Data;
using System.Windows;
using Application = System.Windows.Application;
namespace JiangsuEarthquake
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
private static Mutex mutex = new Mutex(true, "JiangsuEarthquake");
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
if (!mutex.WaitOne(TimeSpan.Zero, true))
{
//MessageBox.Show("应用程序已运行。");
Application.Current.Shutdown();
}
// 程序的其他启动代码...
}
}
}