static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
bool bIsOK;
System.Threading.Mutex mutex = new System.Threading.Mutex(true, "Customs", out bIsOK);
try
{
if (bIsOK)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new F_Main());
mutex.ReleaseMutex();
}
else
{
System.Windows.Forms.MessageBox.Show("程序已在运行。", "提醒", MessageBoxButtons.OK, MessageBoxIcon.Information);
Application.Exit();
}
}
catch( ObjectDisposedException ode)
{
ode.ToString();
}
}
}