Run just one instance application


/ Published in: VB.NET
Save to your folder(s)



Copy this code and paste it in your HTML
  1. Public Function CheckInstanceOfApp() As Boolean
  2. Dim appProc() As Process
  3.  
  4.  
  5. Dim strModName, strProcName As String
  6. strModName = Process.GetCurrentProcess.MainModule.ModuleName
  7. strProcName = System.IO.Path.GetFileNameWithoutExtension(strModName)
  8.  
  9. appProc = Process.GetProcessesByName(strProcName)
  10.  
  11. If appProc.Length > 1 Then
  12. Return False
  13. End If
  14.  
  15. Return True
  16.  
  17. End Function

Report this snippet


Comments


You need to login to view comments.