471,325 Members | 1,629 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,325 software developers and data experts.

Allow only one instance of console application to run

How to allow only one instance of console application to run on one single
machine?

Thanks!

--
WWW: http://hardywang.1accesshost.com
ICQ: 3359839
yours Hardy
Dec 1 '05 #1
3 3534
Well, you could create your own class inherited from the Console class and
add a static field that would keep track of how many instances of your class
there are. You can then check this field in your code to only open a new
console session if there are no other sessions open. This is just a thought
and there might be another more efficient way to do it...anyone?!

Chris

--
Securing your systems is much like fighting off disease -- as long as you
maintain basic hygiene, you're likely to be okay, but you'll never be
invulnerable.

Steve Shah - Unix Systems Network Administrator
"Hardy Wang" <ha*******@newsgroups.nospam> wrote in message
news:OR**************@TK2MSFTNGP10.phx.gbl...
How to allow only one instance of console application to run on one single
machine?

Thanks!

--
WWW: http://hardywang.1accesshost.com
ICQ: 3359839
yours Hardy

Dec 1 '05 #2
Hardy Wang <ha*******@newsgroups.nospam> wrote:
How to allow only one instance of console application to run on one single
machine?


See http://www.pobox.com/~skeet/csharp/f...ation.instance

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Dec 1 '05 #3
Hi ,
I just wanted to check how things are going and whether or not your issue
has been resolved.
If there is any question, please feel free to join the community and we are
here to support you at your convenience. Thanks again and have a nice day.

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Dec 6 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

20 posts views Thread by Michael A. Covington | last post: by
14 posts views Thread by Jordan Marr | last post: by
3 posts views Thread by =?Utf-8?B?QXho?= | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.