How to implement single instance per machine application?
问题 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 applications using a simple mutex until now, but unfortunately such a mutex is per session. Is there a way to create a machine wide mutex or is there any other solution to implement a single instance per machine application? 回答1: I would do this with a global Mutex object that must be kept for the life of your application.