yep ,, that is true
however the alternatives are pretty overdone in my eyes ( carefully
examined them , verry interesting thanks for the links ) especially if
you see the VB6 equivalant , ( big pro for VB6 here )
in my situation my program is called NHSACServer [ Nohau Systems
Aplication Component Server ] i believe this is a pretty strong name
i can`t inmagine that someone would go for a name like that
But you are right ,,,, it isn`t completely safe , if someone names his
apllication the same as you did you might have a problem if the user wants
to start them both at the same time and one of the two applications have the
described method implemented , and is the last one to start ( not the
first as this would not interfere ) :-) Laugh :-)
As you see i do not believe that it is such a big problem , however it
should be known to annyone who implements it,, as anything that can go
wrong will go wrong at some point and it is good to know were to start
searching in the event it does go wrong .
regards
Michel
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:Oj**************@TK2MSFTNGP09.phx.gbl...
"m.posseth" <mi*****@nohausystems.nl> schrieb: This is the .Net equivalant
If Process.GetProcessesByName
(Process.GetCurrentProcess.ProcessName).Length > 1 Then
Note that the process name is not necessarily unique, and thus this
approach may fail. One common alternative is using a mutex:
How do I make sure that only one instance of my application runs at a
time?
<URL:http://www.yoda.arachsys.com/csharp/faq/#one.application.instance>
Restricting Application to a Single Instance
<URL:http://www.codeproject.com/csharp/restricting_instances.asp>
Single Instance Application in VB.NET
<URL:http://www.codeproject.com/vb/net/sing_inistan.asp>
Single Instance Applications in WinForms
<URL:http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=711>
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>