如何在 Visual Basic 中找到我的CPU Name,Architecture和Clock Speed作为字符串?我希望它像这样显示System Properties:Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
我需要答案VB.net。我已经发现了在其他的答案C#,C++,C和Java。
小智 6
VBA 无法直接执行此操作,但您可以调用 Windows 管理界面。
请参阅http://www.asap-utilities.com/excel-tips-detail.php?categorie=9&m=78 中的信息(复制如下)
Sub ProcessorSpeed()
' shows the processor name and speed of the computer
Dim MyOBJ As Object
Dim cpu As Object
Set MyOBJ = GetObject("WinMgmts:").instancesof("Win32_Processor")
For Each cpu In MyOBJ
MsgBox(cpu.Name.ToString + " " + cpu.CurrentClockSpeed.ToString + " Mhz", vbInformation)
Next
End Sub
Run Code Online (Sandbox Code Playgroud)