private static identifier ( string wmiClass, string wmiProperty ) : string | ||
wmiClass | string | |
wmiProperty | string | |
Résultat | string |
private static string identifier(string wmiClass, string wmiProperty)
{
string result = "";
System.Management.ManagementClass mc =
new System.Management.ManagementClass(wmiClass);
System.Management.ManagementObjectCollection moc = mc.GetInstances();
foreach (System.Management.ManagementObject mo in moc) {
//Only get the first one
if (result == "") {
try {
result = mo[wmiProperty].ToString();
break;
} catch {
}
}
}
return result;
}
FingerPrint::identifier ( string wmiClass, string wmiProperty, string wmiMustBeTrue ) : string |