You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
909 B
35 lines
909 B
using System;
|
|
using System.Diagnostics;
|
|
using System.Threading;
|
|
using System.Windows.Forms;
|
|
|
|
namespace AutoUpdate
|
|
{
|
|
internal static class Program
|
|
{
|
|
/// <summary>
|
|
/// 应用程序的主入口点。
|
|
/// </summary>
|
|
[STAThread]
|
|
private static void Main(string[] args)
|
|
{
|
|
bool result;
|
|
var mutex = new Mutex(true, Process.GetCurrentProcess().ProcessName, out result);
|
|
|
|
if (!result)
|
|
{
|
|
MessageBox.Show("另一个实例已经运行");
|
|
return;
|
|
}
|
|
if (args.Length > 0)
|
|
{
|
|
var file = args[0];
|
|
Application.EnableVisualStyles();
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
Application.Run(new UpdateForm(file));
|
|
}
|
|
|
|
GC.KeepAlive(mutex);
|
|
}
|
|
}
|
|
} |