Single instance over a local area network
-
Hi: I am looking for a way to assure that only one instance of a WinForm application can be run on a local area network, how should I go about this? I'm not up to speed with Sockets or UDP communications, so don't really know where to start.
--- Regards, Martin.
-
Hi: I am looking for a way to assure that only one instance of a WinForm application can be run on a local area network, how should I go about this? I'm not up to speed with Sockets or UDP communications, so don't really know where to start.
--- Regards, Martin.
i think the easyest way is to create a dummy file somewhere on the network (accessable to everybody) when your app starts. and delete when app closes. in startup of your app, check for existens of that file (File.Exists) Hope this helps Kaine
-
Hi: I am looking for a way to assure that only one instance of a WinForm application can be run on a local area network, how should I go about this? I'm not up to speed with Sockets or UDP communications, so don't really know where to start.
--- Regards, Martin.
Hmm. I found this topic: http://www.thescripts.com/forum/thread253568.html[^] Doesn't give much info, but from what i can see you can get remote processes by using: Process.GetProcesses("remote pc name"); and that you need to have remote access enabled on the rmeote machine, and maybe some other stuff. You might not need to use sockets at all, although they are rather quite simple to use. So, you'd have to check the processes of each machine individually, and then run your form if you don't find an instance of your form anywhere.
My current favourite word is: Waffle Cheese is still good though.
-
i think the easyest way is to create a dummy file somewhere on the network (accessable to everybody) when your app starts. and delete when app closes. in startup of your app, check for existens of that file (File.Exists) Hope this helps Kaine
Although of course, evil people could find an delete the file, then run the form when theyre not supposed to! :omg: Depends on your circumstances though. This is definitely a good idea though.
My current favourite word is: Waffle Cheese is still good though.
-
Hmm. I found this topic: http://www.thescripts.com/forum/thread253568.html[^] Doesn't give much info, but from what i can see you can get remote processes by using: Process.GetProcesses("remote pc name"); and that you need to have remote access enabled on the rmeote machine, and maybe some other stuff. You might not need to use sockets at all, although they are rather quite simple to use. So, you'd have to check the processes of each machine individually, and then run your form if you don't find an instance of your form anywhere.
My current favourite word is: Waffle Cheese is still good though.
Hmm, I was thinking more along the lines of a Broadcast or Multicast message and reply workaround. The created file solution might be a quick & dirty solution though...
--- Regards, Martin.
-
Hmm, I was thinking more along the lines of a Broadcast or Multicast message and reply workaround. The created file solution might be a quick & dirty solution though...
--- Regards, Martin.