Table of Contents

Class ProcessSingleton

Namespace
Ecng.ComponentModel
Assembly
Ecng.ComponentModel.dll

Provides functionality to ensure that only one instance of the application is running.

public static class ProcessSingleton
Inheritance
ProcessSingleton
Inherited Members

Methods

StartIsRunning(string)

Checks whether an instance of the application is already running.

public static bool StartIsRunning(string appKey)

Parameters

appKey string

A unique key used to enforce the single instance.

Returns

bool

True if this is the first instance and the mutex was successfully acquired; otherwise, false.

Exceptions

InvalidOperationException

Thrown if the mutex has already been initialized.

StopIsRunning()

Releases all resources allocated by the StartIsRunning method.

public static void StopIsRunning()