VB6读取物理内存容量的问题
我在网上找了一个VB6读取物理内存容量的程序。代码:
strComputer = "."
Set wbemServices = GetObject("winmgmts:\\" & strComputer)
Set wbemObjectSet = wbemServices.InstancesOf("Win32_LogicalMemoryConfiguration")
For Each wbemObject In wbemObjectSet
WScript.Echo "物理内存 (MB): " & CInt(wbemObject.TotalPhysicalMemory / 1024)
Next
运行错误:
我查了一下,说是指定类无效。
请问高手,该如何解决?谢谢!