You need SecurityPermission.UnmanagedCode to acquire a named Mutex.

This is sortof an unavoidable fact of life: otherwise, malicious
controls could potentially interfere with other apps, by acquiring
their Mutex(es).

As hacky as it sounds, creating and/or locking a file in Isolated
Storage might be the best way to accomplish this, in a partial-trust
environment.

-S


On Tue, 1 Feb 2005 12:37:29 -0500, Jones, Jason <[EMAIL PROTECTED]> wrote:
> This seems kludgy to me.  If you are going to be grabbing resources, grab a 
> mutex or semaphore, which are designed for cross-process communication.
> 
> Problem is (and this will be a problem with the solution below), since you 
> are doing a NTD, you might not have the permissions to grab local resources.  
> You have to p/invoke to get a semaphore, but you might be able to get a mutex 
> since it's managed.  I am not sure of the particulars, but hopefully you can 
> research it from here.
> 
> ________________________________
> 
> From: Unmoderated discussion of advanced .NET topics. on behalf of saad 
> rehmani
> Sent: Tue 2/1/2005 12:35 PM
> To: [email protected]
> Subject: Re: [ADVANCED-DOTNET] How do I determine if an instance of a smart 
> client is already up?
> 
> 
> Grab a resource on startup. If its not available, your client is still up. Be 
> sure to clean up on exit. Examples:
> 
> - Open a socket listener.
> - Open a file with write access.
> 
> Saad
> .
> 
> Raj Malli <[EMAIL PROTECTED]> wrote:
> Hi all
> 
> I do not want users to launch multiple instances of my smart client. What
> is the simplest way to detect if an instance of a smart client is already
> up? I guess I will not know it from the process list as all I see is
> IEExec.exe (smart client is launched off an IE shortcut) corresponding to
> my smart client application.
> 
> Any pointers is appreciated
> 
> Thanks
> Raj
> 
> ===================================
> This list is hosted by DevelopMentor� http://www.develop.com
> 
> View archives and manage your subscription(s) at http://discuss.develop.com
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> 
> ===================================
> This list is hosted by DevelopMentor�  http://www.develop.com
> 
> View archives and manage your subscription(s) at http://discuss.develop.com
> 
> ===================================
> This list is hosted by DevelopMentor�  http://www.develop.com
> 
> View archives and manage your subscription(s) at http://discuss.develop.com
>

===================================
This list is hosted by DevelopMentor�  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to