找出Windows服务的运行进程名称.NET 1.1 [英] Finding out Windows service's running process name .NET 1.1

查看:299
本文介绍了找出Windows服务的运行进程名称.NET 1.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用的是写的不好窗口服务,当我们试图从代码别闹了,这将挂起。因此,我们需要找到哪些进程正在与该服务,并杀死它。
任何建议。

We are using a badly written windows service, which will hang when we are trying to Stop it from code. So we need to find which process is related to that service and kill it. Any suggestions?

推荐答案

WMI有这样的信息:?Win32_Service类

WMI has this information: the Win32_Service class.

一个WQL查询,如

SELECT ProcessId FROM Win32_Service WHERE Name='MyServiceName'

使用System.Management应该做的伎俩。

using System.Management should do the trick.

从快去看一看: taskllist.exe / SVC ,并在命令行中其他工具

From a quick look see: taskllist.exe /svc and other tools from the command line.

这篇关于找出Windows服务的运行进程名称.NET 1.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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