通过网络强制执行应用程序的单个实例 [英] enforce single instance of the app over a network

查看:201
本文介绍了通过网络强制执行应用程序的单个实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个应用程序运行文件服务器,可以通过局域网在10多台机器上访问。


我想要确保只有一个应用程序实例在整个网络上随时运行。


Previnstance方法不起作用,因为它只检查本地机器而不是网络。


也无法创建一个在关闭时删除的检查文件,因为应用程序有时会崩溃.....

Hi,
I have an application that runs off a file server and can be accessed over the LAN network by 10+ machines.

I want to ensure that only one instance of the application run at any time over the entire network.

the "Previnstance" method does not work as it checks only on the local machine and not the network.

Also cannot create a check file which is deleted at close as the application has a tendency to crash at times.....

推荐答案

使用WMI检查其他计算机以查看正在运行的进程。如果程序已经在另一台机器上运行,请退出程序。用户需要远程访问彼此的计算机,并且可能需要管理员访问才能使用WMI。


作为旁注,您应该解决导致崩溃的问题,而不是解决它。
Use WMI to check the other machines to see which processes are running. Exit the program if it''s already running on another machine. The users will need remote access to each other''s computers and may need admin access to use WMI.

As a side note, you should probably fix the issue causing the crashes rather than working around it.


所有机器都无法访问其他机器......


可以不使用previnstance方法服务器级别????
all machines do not have access to other machines......

can the previnstance method not be used at the server level????


为了实现这一点,我猜测应用程序必须在服务器上运行。
For that to work, I''d guess the application would have to be running on the server.


这篇关于通过网络强制执行应用程序的单个实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆