vb.net 如何防止我的应用程序的多个实例

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25949179/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 18:15:03  来源:igfitidea点击:

How to prevent multiple instances of my application

vb.net

提问by johsns

I discovered a bug in visual basic. In practice, after completing my application, clicking on the executable file that starts normally, but if I click again on the executable file (exe), inexplicably opens a second window, getting two processes started unnecessarily. I was wondering if there was a way, maybe in some settings, to start the application once and only if you have already started and the user clicks on it again, the controls and not the start. You can do this?

我在visual basic中发现了一个错误。在实践中,在我的申请完成后,点击正常启动的可执行文件,但是如果我再次点击可执行文件(exe),莫名其妙地打开了第二个窗口,让两个进程不必要地启动。我想知道是否有办法在某些设置中启动应用程序一次,并且仅当您已经启动并且用户再次单击它时,控件而不是启动。你可以这样做?

回答by Steve

Just go to the Project properties and set the appropriate checkbox

只需转到项目属性并设置适当的复选框

enter image description here

在此处输入图片说明