2011-08-12 76 views

回答

7

我發現它,你必須使用Win32_ServerFeature類(http://msdn.microsoft.com/en-us/library/cc280268(VS.85).aspx)和System.Management.ManagementClass。它適用於ws2008。

ManagementClass objMC = new ManagementClass(
      "Win32_ServerFeature"); 
ManagementObjectCollection objMOC = objMC.GetInstances(); 
foreach (ManagementObject objMO in objMOC) 
{ 
    string featureName = (string)objMO.Properties["Name"].Value; 

} 
相關問題