在本地计算机上查找进程 [英] Find a process on local machine

查看:68
本文介绍了在本地计算机上查找进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Process.GetProcessByName方法确定应用程序是否在本地计算机上运行。 我想在ASP.net网站上使用它来根据用户是否正在运行Jaws屏幕阅读器应用程序
来动态确定要加载的HTML。



Hal

How do I use Process.GetProcessByName method to determine if an application is running on the local machine.  I want to use this on an ASP.net site to dynamically determine HTML to load based on whether a user is running the Jaws screen reader application or not.


Hal

推荐答案

ProcessName通常是启动流程的EXE的文件名,不包括.EXE扩展名。

A ProcessName is typically the filename of the EXE that launches the process, excluding the .EXE extension.

IE:  explorer.exe成为进程名称资源管理器。

IE:  explorer.exe becomes process name explorer.

以下代码应该有所帮助。 它将迭代您计算机上运行的所有进程,并输出包含每个进程名称属性的消息框。 您可以使用它来标识要扫描的进程;
消息框中输出的内容将使用GetProcessByName作为该进程的匹配值。

The following code should help.  It will iterate ALL the processes running on your machine and output a messagebox containing each process's name attribute.  You can use this to identify the process you want to scan for; whatever is output in the messagebox will work as a match value for that process using GetProcessByName.


For Each prc As System.Diagnostics.Process In System.Diagnostics.Process.GetProcesses
        MsgBox(prc.ProcessName)
     Next prc


这篇关于在本地计算机上查找进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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