Control program instance
Dear seniors,
How do I control instance for my program ? For example I only allow my program to have at most 5 instance in a pc, lets give it a name, abc.exe. I only allows my abc.exe to run 5 instance, but if some1's program called abc.exe too, they are not count as my program, and I do not want to use database for this kind of control. Please advice.
Create an entry point in your app, and check for other process instances:
'Entry point
Public Sub Main()
'Only run 5 instances
If Process.GetProcessesByName("MyApp").GetUpperBound(0) < 5 Then
'Launch your app
End If
End Sub
Now, this looks at process names, so presumably you still have the same issue if two different apps have identical process names...Seems unlikely unless some sort of spoofing scenario is occurring? (Guessing, not my area of expertise ;)