Consider following code works on Option Strict = off:
How can we use it without late biding error? Plus the original idea has a "Set" term before "MyOBJ = GetObject(..." part which VS automatically removes it.Code:Dim MyOBJ As Object Dim cpu As Object MyOBJ = GetObject("WinMgmts:").instancesof("Win32_Processor") For Each cpu In MyOBJ MsgBox(cpu.Name.ToString + " " + cpu.CurrentClockSpeed.ToString + " Mhz") Next
Notes:
- In my case it returns 2511MHz in clock frequency (at a loop to a label) all the time which regarding to CPUz small toolkit I'm monitoring changeable value beyond 3300MHz. Why is it constant?
- I rather to use "Performance Counter" component and for following properties,
It also returns 2511 and still a fixed value.Code:.CategoryName = "Processor Performance" .CounterName = "Processor Frequency" .InstantName = "PPM_Processor_0" 'to _3 were my options and already tested them all .MachineName = "."
I would be appreciated if anyone test the Performance counter way on his/her console and give a feedback (I only tested on laptops.)




Reply With Quote
