Public Sub Main()

        Dim creatdnew As Boolean
        Dim inst As System.Threading.Mutex
        inst = New System.Threading.Mutex(True, "WindowsApplication4", creatdnew)

        If creatdnew Then

            System.Windows.Forms.Application.Run(New Form1)
            inst.ReleaseMutex()

        Else

            MessageBox.Show("本程序已经启动", "奇远")
            Application.Exit()

        End If

 

    End Sub

相关文章: