转载  App.Previnstance Equivalent 收藏

  

        Dim appName As String = Process.GetCurrentProcess.ProcessName



        Dim sameProcessTotal As Integer = Process.GetProcessesByName(appName).Length



        If sameProcessTotal > 1 Then



            MessageBox.Show("A previous instance of this application is already open!", " App.PreInstance Detected!", MessageBoxButtons.OK, MessageBoxIcon.Information)



            Me.Close()



        End If



        appName = Nothing



        sameProcessTotal = Nothing

发表于 @ 2008年07月09日 17:44:00 | 评论( loading... ) | 编辑| 举报| 收藏

旧一篇:写在冬日的第一天--一个女程序员第三年工作总结 | 新一篇:Install Windows Service with Interacted with Desktop

  • 发表评论
  • 评论内容:
  •  
Copyright © clear_zero
Powered by CSDN Blog