谁能帮助我知道如何获得Windows服务的PID?
我需要获取PID才能运行以下命令:
Process.Start(new ProcessStartInfo
{
Filename = "cmd.exe",
CreateNoWindow = true,
UseShellExecute = false,
Arguments = string.Format("/c taskkill /pid {0} /f", pidnumber)
});
Run Code Online (Sandbox Code Playgroud) 我需要帮助来使用 C# 终止 Windows 服务,现在要终止该服务,请使用以下选项:
从命令:
sc queryex ServiceName
Run Code Online (Sandbox Code Playgroud)
发现PID服务后
taskkill /pid 1234(exemple) /f
Run Code Online (Sandbox Code Playgroud)