I keep getting a casting exception in the following section of code. I can't seem to convert from the object to int.
is there any way of getting the first element from queryCollection other than having to enmerate through it?
Thanks for yeer help,
ManagementObjectCollection queryCollection = query.Get();
foreach(ManagementObject mo in queryCollection)
obj = mo.InvokeMethod("Terminate", null);
Exception here------>tempint = (int) obj;