Mutex.TryOpenExisting Method (String, MutexRights, Mutex)
Opens the specified named mutex, if it already exists, with the desired security access, and returns a value that indicates whether the operation succeeded.
Assembly: mscorlib (in mscorlib.dll)
[SecurityCriticalAttribute] public static bool TryOpenExisting( string name, MutexRights rights, out Mutex result )
The name of the system mutex to open.
A bitwise combination of the enumeration values that represent the desired security access.
Return ValueType: System.Boolean
true if the named mutex was opened successfully; otherwise, false.
If the named mutex does not exist, this method does not create it. To create the system mutex when it does not already exist, use one of the Mutex constructors that has a name parameter.
If you are uncertain whether a named mutex exists, use this method overload instead of the OpenExisting(String, MutexRights) method overload, which throws an exception if the mutex does not exist.
Multiple calls to this method that use the same value for name do not necessarily return the same Mutex object, even though the objects that are returned represent the same named system mutex.
This method does not request ownership of the mutex.
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.
Available since 4.5