Click here to Skip to main content
15,910,661 members
Home / Discussions / C#
   

C#

 
GeneralRestrict to run application more than one time Pin
Xmen Real 24-Dec-07 4:03
professional Xmen Real 24-Dec-07 4:03 
GeneralRe: Restrict to run application more than one time Pin
Xmen Real 24-Dec-07 4:09
professional Xmen Real 24-Dec-07 4:09 
GeneralRe: Restrict to run application more than one time Pin
Giorgi Dalakishvili24-Dec-07 4:18
mentorGiorgi Dalakishvili24-Dec-07 4:18 
GeneralRe: Restrict to run application more than one time Pin
Xmen Real 24-Dec-07 4:35
professional Xmen Real 24-Dec-07 4:35 
GeneralRe: Restrict to run application more than one time Pin
Giorgi Dalakishvili24-Dec-07 4:56
mentorGiorgi Dalakishvili24-Dec-07 4:56 
GeneralRe: Restrict to run application more than one time Pin
Xmen Real 24-Dec-07 14:44
professional Xmen Real 24-Dec-07 14:44 
GeneralRe: Restrict to run application more than one time Pin
Giorgi Dalakishvili24-Dec-07 20:01
mentorGiorgi Dalakishvili24-Dec-07 20:01 
GeneralRe: Restrict to run application more than one time Pin
Scott Dorman24-Dec-07 5:05
professionalScott Dorman24-Dec-07 5:05 
Your code may be shorter, but it certainly isn't better. The right way to do this is using a mutex which you can guarantee will be unique to your application and doesn't depend on the process name. There are also solutions other than the one presented in the article, but they all work basically the same way. Search for the words "c# single instance application" and you should find a lot more examples.

Scott.

—In just two days, tomorrow will be yesterday.

[Forum Guidelines] [Articles] [Blog]

GeneralRe: Restrict to run application more than one time Pin
User 665824-Dec-07 9:20
User 665824-Dec-07 9:20 
GeneralPreProcessMessage Pin
Sabry190524-Dec-07 1:36
Sabry190524-Dec-07 1:36 
GeneralRe: PreProcessMessage Pin
Anthony Mushrow24-Dec-07 5:05
professionalAnthony Mushrow24-Dec-07 5:05 
GeneralRe: PreProcessMessage Pin
Sabry190524-Dec-07 5:12
Sabry190524-Dec-07 5:12 
GeneralRe: PreProcessMessage Pin
Sabry190525-Dec-07 2:05
Sabry190525-Dec-07 2:05 
Generalwho i can Deasmplyee file Pin
Thaer Hamael24-Dec-07 1:14
Thaer Hamael24-Dec-07 1:14 
GeneralRe: who i can Deasmplyee file Pin
User 665824-Dec-07 1:44
User 665824-Dec-07 1:44 
GeneralAdd .wav file Pin
Strategic_Thinker24-Dec-07 0:55
Strategic_Thinker24-Dec-07 0:55 
GeneralRe: Add .wav file Pin
Paul Conrad24-Dec-07 19:36
professionalPaul Conrad24-Dec-07 19:36 
GeneralRe: Add .wav file Pin
Strategic_Thinker25-Dec-07 3:56
Strategic_Thinker25-Dec-07 3:56 
Question[Message Deleted] Pin
Firdous24-Dec-07 0:07
Firdous24-Dec-07 0:07 
GeneralRe: What is innumerable and enumerator in c#? Pin
Pete O'Hanlon24-Dec-07 0:32
mvePete O'Hanlon24-Dec-07 0:32 
GeneralRe: What is innumerable and enumerator in c#? Pin
Vikram A Punathambekar24-Dec-07 0:59
Vikram A Punathambekar24-Dec-07 0:59 
GeneralRe: [Message Deleted] Pin
Colin Angus Mackay24-Dec-07 5:12
Colin Angus Mackay24-Dec-07 5:12 
GeneralRe: Deleted Message Pin
Paul Conrad24-Dec-07 5:53
professionalPaul Conrad24-Dec-07 5:53 
GeneralRe: Deleted Message Pin
Colin Angus Mackay24-Dec-07 6:02
Colin Angus Mackay24-Dec-07 6:02 
GeneralRe: Deleted Message Pin
Paul Conrad24-Dec-07 6:04
professionalPaul Conrad24-Dec-07 6:04 

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.