How to implement single instance per machine application?

前端 未结 7 2087
無奈伤痛
無奈伤痛 2020-12-06 17:42

I have to restrict my .net 4 WPF application so that it can be run only once per machine. Note that I said per machine, not per session.
I implemented single instance ap

相关标签:
7条回答
  • 2020-12-06 18:24

    I did something similar once.

    When staring up the application list, I checked all running processes for a process with identical name, and if it existed I would not allow to start the program.

    This is not bulletproof of course, since if another application have the exact same process name, your application will never start, but if you use a non-generic name it will probably be more than good enough.

    0 讨论(0)
提交回复
热议问题