在编程语言Visual Basic中获取CPU ID [英] getting the cpu id in the programming language visual basic

查看:68
本文介绍了在编程语言Visual Basic中获取CPU ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助以使我的cpu ID以可视化语言显示在Visual Basic中
我真正想做的就是将杯子ID贴在标签上

我尝试了此代码,但出现了很多错误
在这里
导入System.Management

i need help in order to get my cpu id in the programming language visual basic
what i really want to do is to get the cup id to be on a label

i try this code but i get a load of errors
here it is
Imports System.Management

Dim objMOS As ManagementObjectSearcher

        Dim objMOC As Management.ManagementObjectCollection

        Dim objMO As Management.ManagementObject

        objMOS = New ManagementObjectSearcher("Select * From Win32_Processor")

        objMOC = objMOS.Get

        For Each objMO In objMOC

            Label31.Text = ("CPU ID = " & objMO("ProcessorID"))

        Next

        objMOS.Dispose()

        objMOS = Nothing

        objMO.Dispose()

        objMO = Nothing

推荐答案

,错误将是..... ?? ?


CPUID返回有关处理器的信息.它不是您的特定处理器的唯一序列号.

您可能需要阅读ProcessorID字段返回的内容,此处 [此处 [
And the errors would be .....???


CPUID returns information about the processor. It is not the unique serial number for your particular processor.

You might want to read up on what the ProcessorID field returns, here[^], and what is returned when EAX is set to 1 during the call to CPUID. That would be the Processor Info and Feature Bits, but all of them. The docs on that can be found here[^].


Oh, and you forgot this:
Label31.Text = "CPU ID = " & objMO("ProcessorID").Value


这篇关于在编程语言Visual Basic中获取CPU ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆