簡體   English   中英

我怎么知道在C#中的遠程計算機上運行的服務的說明?

[英]How do I know the Description of the service that is running in remote machine in C#?

我知道正在使用的服務

ServiceController sc = new ServiceController();
ServiceController.GetServices(DropDownListMachineName.SelectedValue))

但是ServiceController不包含任何獲取服務描述的方法或屬性。

任何想法 ?

這個MSDN頁面建議:

ManagementObject wmiService;
wmiService = new ManagementObject("Win32_Service.Name='" + sc.ServiceName + "'");
wmiService.Get();
Console.WriteLine("    Description:     {0}", wmiService["Description"]);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM