I have a c# application that is on a shared folder in which I have 3 or 4 people who all run the same .exe file. I need to be able to count all instances of the running process.
So far I've tried mutex and:
Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length;
those work if I'm trying to compute the number of instances of the .exe file I have running on my machine, but this will be running on multiple machines all pointing back to the same shared executable.
I don't want to create a file that increments and decrements depending on if a user opens or closes it for that would be unreliable.
--------edit--------------
Does anybody know how Excel does it? If the 2nd person opens the file it says that it is in use and tells you who is using it Thank you for your help!!!
There isn't any way other than to implement some form of a licensing service or if you have privileges to the running machines.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With