I developed an application that is hosted in one server. Many users access to it via Remote Desktop connection, but sometimes I saw in the task manager that the same user ha
bool b = true;
Mutex mutex = new Mutex(true, Environment.UserName.ToLowerInvariant() , out b);
if (!b) throw new InvalidOperationException("Another instance is running");