using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Diagnostics;

 

namespace WindowsFormsApplication1
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
        static bool TestIfAlreadyRunning()
        {
            Process processCurrent = Process.GetCurrentProcess();
            Process[] processes = Process.GetProcesses();
            foreach (Process process in processes)
                if (processCurrent.Id != process.Id)
                    if (processCurrent.ProcessName == process.ProcessName)
                        return true;
            return false;
        }
    }
}

相关文章:

  • 2021-11-07
  • 2022-12-23
  • 2021-11-20
  • 2021-09-04
  • 2022-01-31
  • 2021-12-20
  • 2021-06-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
  • 2021-06-13
  • 2021-09-07
  • 2022-12-23
相关资源
相似解决方案