12345678910111213141516171819202122232425262728293031323334 |
- using System;
- using System.Collections.Generic;
- using System.Configuration;
- using System.Data;
- using System.Linq;
- using System.Threading.Tasks;
- using System.Windows;
- namespace UploadClient
- {
- /// <summary>
- /// App.xaml 的交互逻辑
- /// </summary>
- public partial class App : Application
- {
- System.Threading.Mutex mutex;
- public App()
- {
- this.Startup += new StartupEventHandler(App_Startup);
- }
- void App_Startup(object sender, StartupEventArgs e)
- {
- bool ret;
- mutex = new System.Threading.Mutex(true, "UploadClient", out ret);
- if (!ret)
- {
- MessageBox.Show("部署工具只能开启一个");
- Environment.Exit(0);
- }
- }
- }
- }
|