public:computer:c_single_instance

C#, Single Instance.

http://www.devpia.com/MAEUL/Contents/Detail.aspx?BoardID=217&MAEULNO=8&no=25391&page=8

static void Main()
 {
             bool checkOther = false;
             try
             {
                 m_OneProcess = new System.Threading.Mutex (true, "App", out checkOther);

                 if (false == checkOther)
                 {
                     return ;
                 }

                 Application.Run(new Form1());

             }

             catch {}
             finally
             {
                 if (null != m_OneProcess && false != checkOther)
                 {
                     m_OneProcess.ReleaseMutex ();
                 }
             }
 }

  • public/computer/c_single_instance.txt
  • Last modified: 2021/03/17 18:14
  • by alex