如何防止在应用程序/软件运行时打开它 [英] how to prevent to open the application/software when it is already running

查看:58
本文介绍了如何防止在应用程序/软件运行时打开它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个媒体播放器并创建了它的安装文件..我也成功地将播放器安装在我的电脑中。



但是当我的媒体播放器是打开还是运行,如果我点击快捷方式或.exe文件,它会在不同的窗口中再次打开媒体播放器..



当我的播放器是已经打开它会阻止再打开它...



怎么办?

任何人都能帮帮我吗?

I have developed a media player and created a setup file of it.. and i have also successfully installed the player in my computer.

But when my media player is open or running ,if i click on shortcut or .exe file it open ups the media player again in different window..

I want that when my player is already open it prevents to open run it again..

how to do it?
Can any one help me?

推荐答案

看到这个问题:创建单实例应用程序的正确方法是什么? [ ^ ] at Stack Overflow
See this question: "What is the correct way to create a single instance application?"[^] at Stack Overflow.


在这种情况下,您应该将应用程序开发为 Single实例申请

请参考以下链接:

单实例C#应用程序 - 用于.NET 2.0 [ ^ ]

C#中的单实例应用程序 [ ^ ]

C#.Net单实例应用程序 [ ^ ]。





--Amit
In that case you should develop the application as Single Instance Application.
Refer the links below:
Single-Instance C# Application - for .NET 2.0[^]
Single Instance Application in C#[^]
C# .Net single instance application[^].


--Amit


这篇关于如何防止在应用程序/软件运行时打开它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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