-4
如何將managementobject收集轉換爲IEnumerable<IEnumerable<IPropertyData>>
其中propertydata僅爲名稱和值?如何將managementobject集合轉換爲IEnumerable <IEnumerable <IPropertyData >>?
interface IPropertyData
{
string Name { get; }
object Value { get; }
}
class ManagementObjectInfo : IManagementInfo
{
public IEnumerable<IEnumerable<IPropertyData>> Get(string query)
{
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
return searcher.Get() ;
}
}