A
active
This works with Strict Off
But not with Strict On
Sometimes I can figure out what is needed by running it and using QuickWatch
to see the type required but
GetObject("winmgmts:\\" & StrComputer & "\root\cimv2")
returns a value System._ComObject of Type Object
I don't know what to make of that.
Do you know how to fix this code?
thanks in advance
Dim StrComputer As String = "."
Dim ObjWMIService As Object = GetObject("winmgmts:\\" & StrComputer &
"\root\cimv2")
Dim ColItems As Object = ObjWMIService.ExecQuery("Select * from
Win32_Processor")
For Each objItem As Object In ColItems
Console.WriteLine("L2 Cache Size: " & objItem.L2CacheSize)
Console.WriteLine("L2 Cache Speed: " & objItem.L2CacheSpeed)
Console.WriteLine("Current Voltage: " & objItem.CurrentVoltage / 10.0)
Console.WriteLine("Maximum Clock Speed: " & objItem.currentClockSpeed)
Next
But not with Strict On
Sometimes I can figure out what is needed by running it and using QuickWatch
to see the type required but
GetObject("winmgmts:\\" & StrComputer & "\root\cimv2")
returns a value System._ComObject of Type Object
I don't know what to make of that.
Do you know how to fix this code?
thanks in advance
Dim StrComputer As String = "."
Dim ObjWMIService As Object = GetObject("winmgmts:\\" & StrComputer &
"\root\cimv2")
Dim ColItems As Object = ObjWMIService.ExecQuery("Select * from
Win32_Processor")
For Each objItem As Object In ColItems
Console.WriteLine("L2 Cache Size: " & objItem.L2CacheSize)
Console.WriteLine("L2 Cache Speed: " & objItem.L2CacheSpeed)
Console.WriteLine("Current Voltage: " & objItem.CurrentVoltage / 10.0)
Console.WriteLine("Maximum Clock Speed: " & objItem.currentClockSpeed)
Next