using System;
using System.Threading;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            bool createdNew;
            using (new Mutex(true,Application.ProductName,out createdNew))
            {
                if (createdNew)
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    Application.Run(new Form1());
                }
                else
                {
                    // todo:提示程序已启动
                }
            }
        }
    }
}

 

相关文章:

  • 2022-12-23
  • 2021-10-28
  • 2022-02-23
  • 2022-02-09
  • 2021-06-15
  • 2021-06-28
  • 2022-12-23
猜你喜欢
  • 2021-09-19
  • 2021-07-28
  • 2022-12-23
  • 2022-12-23
  • 2022-02-04
  • 2022-12-23
  • 2022-01-31
相关资源
相似解决方案