vb.netcpu信息 vbnet using

vb.netfor循环占用cpu问题重新启动 。vbnetfor循环占用cpu问题只要重新启动就可以了 。VBNET是一种简单,现代,面向对象的计算机编程语言 , 它由微软开发,将NETFramework和公共语言运行库的强大功能相结合 。
如何用VB.Net进行CPU温度读取没有命令可以查看CPU温度,可以通过第三方软件鲁大师查看CPU温度:
百度搜索鲁大师,并进行下载安装;
运行已安装的软件的,在界面中就能看到CPU温度:
VB.NET,部分机器获取不了CPU号(高分急用)VB 我不熟,下面是用汇编写的 , 我运行过可以的 。
//--------------------------------
.model small
.586
.stack
.code
idstring db 49 dup('$')
start:
mov ax,@code
mov ds,ax
lea di,idstring
mov eax,80000002h
cpuid
mov dword ptr [di],eax
mov dword ptr [di 4],ebx
mov dword ptr [di 8],ecx
mov dword ptr [di 12],edx
mov eax,80000003h
cpuid
mov dword ptr [di 16],eax
mov dword ptr [di 20],ebx
mov dword ptr [di 24],ecx
mov dword ptr [di 28],edx
mov eax,80000004h
cpuid
mov dword ptr [di 32],eax
mov dword ptr [di 36],ebx
mov dword ptr [di 40],ecx
mov dword ptr [di 44],edx
mov ah,09h
lea dx,idstring
int 21h
mov ah,4ch
int 21h
end start
//-------------------------------------------------------
程序确实可以执行,输出CPU的ID等信息 。
注意:DOS下或MS-DOS下使用 。
vb.net 如何获取当前系统的CPU使用率使用wmi
类“Win32_Processor”中LoadPercentage属性为当前的cpu使用率
示例代码: PrivateSubTimer1_Timer()
DimWMI服务AsObject
Dim对象AsObject
Dim子对象AsObject
Dim电脑名AsString
Dim刷新AsLong
刷新=0
电脑名="."'表示本地计算机
SetWMI服务=GetObject("winmgmts://"电脑名"/root/cimv2")
Set对象=WMI服务.InstancesOf("Win32_Processor")
Me.CurrentX=0
Me.CurrentY=0
ForEach子对象In对象
If刷新=0Then
刷新=1
Me.Cls
EndIf
Me.Print子对象.Name"["子对象.CurrentClockSpeed"Hz]使用率:"_
子对象.LoadPercentage"%"
Next
EndSub
VB.NET怎么编程测试CPU电压'
'?。。≈匾菏紫纫砑印耙谩币桓鰀ll,选择“System Management”;
'
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Imports System.Management
Imports System.IO
Namespace WindowsApplication1
Partial Public Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
'获取CPU编号
Dim [MyClass] As New ManagementClass("Win32_Processor")
Dim MyCollection As ManagementObjectCollection = [MyClass].GetInstances()
Dim MyInfo As String = "当前系统CPU编号是:"
Dim MyCPUID As String = ""
For Each MyObject As ManagementObject In MyCollection
MyCPUID = MyObject.Properties("ProcessorId").Value.ToString()
Exit For
Next MyObject
MyInfo = MyCPUID
MessageBox.Show(MyInfo, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Private Sub button2_Click(ByVal sender As Object, ByVal e As EventArgs)
'获取计算机CPU的当前电压
Dim MyInfo As String = "计算机CPU的当前电压是:"
Dim MySearcher As New ManagementObjectSearcher("SELECT * FROM Win32_Processor")
For Each MyObject As ManagementObject In MySearcher.Get()
Try
MyInfo = ControlChars.LfString.Format("CurrentVoltage : "MyObject("CurrentVoltage").ToString())
MyInfo = ControlChars.Lf"========================================================="
Catch
End Try
Next MyObject
MessageBox.Show(MyInfo, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Private Sub button3_Click(ByVal sender As Object, ByVal e As EventArgs)
'获取计算机CPU的外部频率
Dim MyInfo As String = "计算机CPU的外部频率是:"
Dim MySearcher As New ManagementObjectSearcher("SELECT * FROM Win32_Processor")
For Each MyObject As ManagementObject In MySearcher.Get()
Try
MyInfo = ControlChars.LfString.Format("ExtClock : "MyObject("ExtClock").ToString())
MyInfo = ControlChars.Lf"========================================================="
Catch
End Try
Next MyObject
MessageBox.Show(MyInfo, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Private Sub button4_Click(ByVal sender As Object, ByVal e As EventArgs)
'获取计算机CPU的二级缓存
Dim MyInfo As String = "计算机CPU的二级缓存尺寸是:"
Dim MySearcher As New ManagementObjectSearcher("SELECT * FROM Win32_Processor")
For Each MyObject As ManagementObject In MySearcher.Get()
MyInfo = ControlChars.LfString.Format("L2CacheSize: "MyObject("L2CacheSize").ToString())
MyInfo = ControlChars.Lf"========================================================="
Next MyObject
MessageBox.Show(MyInfo, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Private Sub button5_Click(ByVal sender As Object, ByVal e As EventArgs)
'获取计算机CPU的制造商名称
Dim MyInfo As String = "计算机CPU的制造商名称是:"
Dim MySearcher As New ManagementObjectSearcher("SELECT * FROM Win32_Processor")
For Each MyObject As ManagementObject In MySearcher.Get()
MyInfo = ControlChars.LfString.Format("Manufacturer : "MyObject("Manufacturer").ToString())
MyInfo = ControlChars.Lf"========================================================="
Next MyObject
MessageBox.Show(MyInfo, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Private Sub button6_Click(ByVal sender As Object, ByVal e As EventArgs)
'获取计算机CPU的产品名称
Dim MyInfo As String = "计算机CPU的产品名称是:"
Dim MySearcher As New ManagementObjectSearcher("SELECT * FROM Win32_Processor")
For Each MyObject As ManagementObject In MySearcher.Get()
MyInfo = ControlChars.LfString.Format("Name : "MyObject("Name").ToString())
MyInfo = ControlChars.Lf"========================================================="
Next MyObject
MessageBox.Show(MyInfo, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Private Sub button7_Click(ByVal sender As Object, ByVal e As EventArgs)
'获取计算机CPU的版本信息
Dim MyInfo As String = "计算机CPU的版本信息如下:"
Dim MySearcher As New ManagementObjectSearcher("SELECT * FROM Win32_Processor")
For Each MyObject As ManagementObject In MySearcher.Get()
MyInfo = ControlChars.LfString.Format("Version: "MyObject("Version").ToString())
MyInfo = ControlChars.Lf"========================================================="
Next MyObject
MessageBox.Show(MyInfo, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Private Sub button8_Click(ByVal sender As Object, ByVal e As EventArgs)
'获取计算机CPU的当前使用百分比 注意要把SQLserver或者其他耗CPU的软件开着否则看不到效果就一直为0
Dim MyInfo As String = "计算机CPU的当前使用百分比是:"
Dim MySearcher As New ManagementObjectSearcher("SELECT * FROM Win32_Processor")
For Each MyObject As ManagementObject In MySearcher.Get()
MyInfo = ControlChars.LfString.Format("LoadPercentage : "MyObject("LoadPercentage").ToString())
MyInfo = ControlChars.Lf"========================================================="
Next MyObject
MessageBox.Show(MyInfo, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Private Sub button9_Click(ByVal sender As Object, ByVal e As EventArgs)
'获取计算机CPU的最大时钟频率
Dim MyInfo As String = "计算机CPU的最大时钟频率是:"
Dim MySearcher As New ManagementObjectSearcher("SELECT * FROM Win32_Processor")
For Each MyObject As ManagementObject In MySearcher.Get()
MyInfo = ControlChars.LfString.Format("MaxClockSpeed : "MyObject("MaxClockSpeed").ToString())
MyInfo = ControlChars.Lf"========================================================="
Next MyObject
MessageBox.Show(MyInfo, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Private Sub button10_Click(ByVal sender As Object, ByVal e As EventArgs)
'获取计算机CPU的当前时钟频率
Dim MyInfo As String = "计算机CPU的当前时钟频率是:"
Dim MySearcher As New ManagementObjectSearcher("SELECT * FROM Win32_Processor")
For Each MyObject As ManagementObject In MySearcher.Get()
MyInfo = ControlChars.LfString.Format("CurrentClockSpeed : "MyObject("CurrentClockSpeed").ToString())
MyInfo = ControlChars.Lf"========================================================="
Next MyObject
MessageBox.Show(MyInfo, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Private Sub button11_Click(ByVal sender As Object, ByVal e As EventArgs)
'获取计算机的CPU地址宽度
Dim MyInfo As String = "当前计算机的CPU地址宽度是:"
Dim MySearcher As New ManagementObjectSearcher("SELECT * FROM Win32_Processor")
For Each MyObject As ManagementObject In MySearcher.Get()
MyInfo = ControlChars.LfString.Format("AddressWidth: "MyObject("AddressWidth").ToString())
MyInfo = ControlChars.Lf"========================================================="
Next MyObject
MessageBox.Show(MyInfo, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Private Sub button14_Click(ByVal sender As Object, ByVal e As EventArgs)
'获取计算机的CPU数据宽度
Dim MyInfo As String = "当前计算机的CPU数据宽度是:"
Dim MySearcher As New ManagementObjectSearcher("SELECT * FROM Win32_Processor")
For Each MyObject As ManagementObject In MySearcher.Get()
MyInfo = ControlChars.LfString.Format("DataWidth : "MyObject("DataWidth").ToString())
MyInfo = ControlChars.Lf"========================================================="
Next MyObject
MessageBox.Show(MyInfo, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
End Class
【vb.netcpu信息 vbnet using】关于vb.netcpu信息和vbnet using的介绍到此就结束了 , 不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。

    推荐阅读