Maintaining single instance application

时间秒杀一切 提交于 2020-01-13 06:26:06

问题


I have been working on this application of mine and got this problem. Running program through command line with different arguments opens different .exe process.

My question is how can i prevent from opening same file few times, and is it possible to send new command line arguments to already open instance of application.

Thanks.


回答1:


There are standard .NET classes for that. Check out:

http://www.openwinforms.com/single_instance_application.html

http://www.smartasses.be/2009/04/24/single-instance-application-with-c/

http://www.google.be/search?source=ig&hl=nl&rlz=&q=SingleInstanceApplication&btnG=Google+zoeken&meta=



来源:https://stackoverflow.com/questions/2849687/maintaining-single-instance-application

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!