F
Franz
When I want to get the count of the ManagementClassCollection, I get a
ProviderFailure.
I don't know why I get this error and what this error means. Can anyone help
me? Thank you.
ManagementClass manClass = new ManagementClass("Win32_CDROMDrive");
ManagementObjectCollection manObjCol = manClass.GetInstances();
if (manObjCol != null) {
try {
Console.WriteLine(manObjCol.Count);
}
catch (System.Management.ManagementException e) {
Console.WriteLine(e.Message);
}
}
ProviderFailure.
I don't know why I get this error and what this error means. Can anyone help
me? Thank you.
ManagementClass manClass = new ManagementClass("Win32_CDROMDrive");
ManagementObjectCollection manObjCol = manClass.GetInstances();
if (manObjCol != null) {
try {
Console.WriteLine(manObjCol.Count);
}
catch (System.Management.ManagementException e) {
Console.WriteLine(e.Message);
}
}