Single Instance Application in C#

Introduction
Single-instance an application means enabling the application to recognize, at startup, if another running instance of itself is already running, In this case, the new application stops its execution. Generally, for a form based application, the new instance activates (brings the application window to foreground) the previous instance, if its already running.

Using the code
To make a single instance application, add file SingleApplication.cs in your project. It adds a new class SingleApplication defined in namespace SingleInstance and adds the following code for a form based application to your startup code:


See full detail: http://www.codeproject.com/KB/cs/singleinstance.aspx

Comments

Popular posts from this blog

Very fast test data generation using exponential INSERT

Basic concept and fundamentals of ASP.NET MVC (Model View Controller) Architecture

MVC Architecture Model In ASP.NET