如何检查应用程序是否在C#中从其他应用程序运行 [英] How Do I Check If Application Is Running From Other Application In C#

查看:64
本文介绍了如何检查应用程序是否在C#中从其他应用程序运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,



我有两张win form申请表。我需要检查当用户打开应用程序2时,通过单击图标,它应检查应用程序1是否正在运行。如果应用程序1正在运行而且只有应用程序2应该打开,否则它将只显示一个消息框,请先打开应用程序1然后打开应用程序2.



i知道从单个应用程序,我们可以检查进程是否正在运行,但不知道我们如何从其他应用程序检查这个。



i have two win form application. i need to check that when user open app 2 , by clicking on icon it should check if app 1 is running or not. if app 1 is running than and only app 2 should open otherwise it will just show a message box that please open app 1 first and then open app 2.

i know that from single app we can check the whether the process is running or not but don't know how we can check this from other application.

推荐答案

有大量的例子但是这个CodeProject文章可能有助于在C#中查找和列出流程 [ ^ ]
There are loads of examples out there but this CodeProject article might help Finding and Listing Processes in C#[^]


请参考:

http://stackoverflow.com/questions/4722198/checking-if-windows-application-is-running [ ^ ]


这篇关于如何检查应用程序是否在C#中从其他应用程序运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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