[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

how to make sure single instance of exe is running?

Nagaraju

11/11/2003 6:47:00 PM

Hi,

We are developing a .NET assembly(EXE). We wanted to make
sure that only one instance of EXE running. Is there any
way to verify(using framework classes) other instance
same exe is running or not? If it is then we can exit.

Hope I am clear.

Thanks
Nagaraju
4 Answers

Michael Giagnocavo

11/11/2003 7:20:00 PM

0

Sure, you can use a System.Threading.Mutex to achieve this.

http://groups.google.com/groups?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=dotnet+mutex+singl...

2nd result has some code, as do many of the other results.

-mike
MVP


"Nagaraju" <nagrajgv@hotmail.com> wrote in message
news:054901c3a884$1f3b1120$a101280a@phx.gbl...
> Hi,
>
> We are developing a .NET assembly(EXE). We wanted to make
> sure that only one instance of EXE running. Is there any
> way to verify(using framework classes) other instance
> same exe is running or not? If it is then we can exit.
>
> Hope I am clear.
>
> Thanks
> Nagaraju


=?Utf-8?B?cm9kY2hhcg==?=

11/12/2003 12:27:00 AM

0

great.

Thanks mike.


-Nagaraju
>-----Original Message-----
>Sure, you can use a System.Threading.Mutex to achieve
this.
>
>http://groups.google.c...
sourceid=navclient&ie=UTF-8&oe=UTF-
8&q=dotnet+mutex+single+instance
>
>2nd result has some code, as do many of the other
results.
>
>-mike
>MVP
>
>
>"Nagaraju" <nagrajgv@hotmail.com> wrote in message
>news:054901c3a884$1f3b1120$a101280a@phx.gbl...
>> Hi,
>>
>> We are developing a .NET assembly(EXE). We wanted to
make
>> sure that only one instance of EXE running. Is there
any
>> way to verify(using framework classes) other instance
>> same exe is running or not? If it is then we can exit.
>>
>> Hope I am clear.
>>
>> Thanks
>> Nagaraju
>
>
>.
>

=?Utf-8?B?cm9kY2hhcg==?=

11/12/2003 1:22:00 PM

0

HI Nagaraj,

U can use system.diagnstics name space and find the all
process running on the machine.
if you find your Process name in the Process Collection
you can prompt a MSG and exit the Application

bye
Srinivas
>-----Original Message-----
>Hi,
>
>We are developing a .NET assembly(EXE). We wanted to make
>sure that only one instance of EXE running. Is there any
>way to verify(using framework classes) other instance
>same exe is running or not? If it is then we can exit.
>
>Hope I am clear.
>
>Thanks
>Nagaraju
>.
>

Michael Giagnocavo

11/12/2003 4:52:00 PM

0

That doesn't always work. What if the user renames the executable?
-mike
MVP

"Srinivas" <anonymous@discussions.microsoft.com> wrote in message
news:0da201c3a91f$ed6e8770$a301280a@phx.gbl...
> HI Nagaraj,
>
> U can use system.diagnstics name space and find the all
> process running on the machine.
> if you find your Process name in the Process Collection
> you can prompt a MSG and exit the Application
>
> bye
> Srinivas
> >-----Original Message-----
> >Hi,
> >
> >We are developing a .NET assembly(EXE). We wanted to make
> >sure that only one instance of EXE running. Is there any
> >way to verify(using framework classes) other instance
> >same exe is running or not? If it is then we can exit.
> >
> >Hope I am clear.
> >
> >Thanks
> >Nagaraju
> >.
> >