Click here to Skip to main content
15,899,314 members
Articles / Desktop Programming / Windows Forms

Run Only One Copy Of Application

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
12 Apr 2011CPOL 6.7K   2  
How about using a Mutex? This should also work for Terminal Services sessions. Use in Program.csstatic Mutex mut;try{ bool isOwned = false; mut = new Mutex(true, Application.ProductName + " MUTEX: {53A4988C-F91F-4054-9076-220AC5EC03F3}", out isOwned); if (!isOwned)...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Junior) Employment Law Advisory Services Ltd
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions