Click here to Skip to main content
12,254,932 members (60,407 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

3.9K views
2 bookmarked
Posted

Video tip C#: Ensure only one instance is running

, 2 Nov 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
I would use a mutex object - using the process name might cause errors. Try "WaitOne" on the mutex - only the first process will be able to acquire it, and in the case of a failure, just exit.

I would use a mutex object - using the process name might cause errors. Try "WaitOne" on the mutex - only the first process will be able to acquire it, and in the case of a failure, just exit.

License

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

Share

About the Author

impeham
Software Developer
Israel Israel
No Biography provided

You may also be interested in...

Comments and Discussions

 
GeneralReason for my vote of 5 yep thats the way to go Pin
johannesnestler24-Jan-12 6:01
memberjohannesnestler24-Jan-12 6:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160426.1 | Last Updated 2 Nov 2011
Article Copyright 2011 by impeham
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid