using System.Diagnostics;

static class Program
{
    [STAThread]
    static void Main()
    {
        if (IsPrevInstance())
            return;
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(fals  e);
        Application.Run(new Form1());
    }
 
    private static bool IsPrevInstance()
    {
        string processName = Process.GetCurrentProcess().ProcessName;
        Process[] instances = Process.GetProcessesByName(processName);
        if (instances.Length > 1)
            return true;
        else
            return false;
    }
}