Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / March 2006

Tip: Looking for answers? Try searching our database.

Identify multiple running instances of an application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michel - 13 Mar 2006 16:19 GMT
Hi, I wrote an app in .Net and I whant only 1 instance of this app open for
the user; the user open my app, do some works and try to open another
instance of my app, I whant to show a message to user to inform hmi only one
instance is permit and close the second instance after that.

I am able to do this when the user run the application on his PC whit this :

Process.GetProcessesByName(Process.GetCurrentProcess.ProcessName)

and if I found the name of my app in the returned collection, I display the
message and close the seconde instance.

The problem now: if my application is used by Remote session on a central PC
who others users can also open my application at the same time, I would like
to let the others users open my app. The only one contrainte is one instance
by user. The code I used does not work in this scenario.

Does anyone have idea to solution this ?

Thanks a lot
Michel
Jon Skeet [C# MVP] - 13 Mar 2006 18:57 GMT
> Hi, I wrote an app in .Net and I whant only 1 instance of this app open for
> the user; the user open my app, do some works and try to open another
> instance of my app, I whant to show a message to user to inform hmi only one
> instance is permit and close the second instance after that.

See http://www.pobox.com/~skeet/csharp/faq/#one.application.instance

Signature

Jon Skeet - <skeet@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

Michel - 13 Mar 2006 19:40 GMT
Thank you Jon, I will try it ....

Michel

> > Hi, I wrote an app in .Net and I whant only 1 instance of this app open for
> > the user; the user open my app, do some works and try to open another
> > instance of my app, I whant to show a message to user to inform hmi only one
> > instance is permit and close the second instance after that.
>
> See http://www.pobox.com/~skeet/csharp/faq/#one.application.instance

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.