WinFormでは1つのプログラムしか開くことができません

1356 ワード

using System;

using System.Collections.Generic;

using System.Windows.Forms;



namespace Dachie

{

    static class Program

    {

        /// <summary>

        /// The main entry point for the application.

        /// </summary>

        [STAThread]

        static void Main()

        {

            Application.EnableVisualStyles();

            Application.SetCompatibleTextRenderingDefault(false);

            bool createNew;



            System.Threading.Mutex mutex = new System.Threading.Mutex(true, Application.ProductName, out createNew);

            if (createNew)

                Application.Run(new login());

        }

    }

}