Exemplo n.º 1
0
        static void Main(string[] args)
        {
            int    argsCount       = args.Length;
            string argInstanceType = (argsCount <= 0) ? "" : args[0];

            if (argInstanceType == "-Multi")
            {
                StartupApplication();
            }
            else if (SingleInstance.CreateMutex())
            {
                StartupApplication();
                SingleInstance.ReleaseMutex();
            }
            else
            {
                if (!SingleInstance.HandleRunningInstance())
                {
                    //MessageBox.Show("该应用程序已经启动!", "启动", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }