Click here to Skip to main content
Click here to Skip to main content
Alternative Tip/Trick

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

Comments and Discussions

 
GeneralReason for my vote of 5 yep thats the way to go Pinmemberjohannesnestler24-Jan-12 7:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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
Web03 | 2.8.150129.1 | Last Updated 2 Nov 2011
Article Copyright 2011 by impeham
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid