2010-04-13 7 views

답변

1

하는 WMI 쿼리를 실행하여 수행 할 수있는 다음 WMI의 Win32_Service 클래스에 대한 추가 정보를 원하시면

// Setup the query 
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", 
        "SELECT * FROM Win32_Service WHERE Name = 'Blah'"); 

// Execute the query and enumerate the objects 
foreach (ManagementObject queryObj in searcher.Get()) 
{ 
    // examine the query results to find the info you need. For example: 
    string name = (string)queryObj["Name"]; 
    bool started = (bool)queryObj["Started"]; 
    string status = (string)queryObj["Status"]; 
} 

을 볼 here.

관련 문제