免费观看又色又爽又黄的小说免费_美女福利视频国产片_亚洲欧美精品_美国一级大黄大色毛片

vb.net中用cpu vb和vb net

vb.netfor循環(huán)占用cpu問題

重新啟動(dòng)。vbnetfor循環(huán)占用cpu問題只要重新啟動(dòng)就可以了。VBNET是一種簡(jiǎn)單,現(xiàn)代,面向?qū)ο蟮挠?jì)算機(jī)編程語(yǔ)言,它由微軟開發(fā),將NETFramework和公共語(yǔ)言運(yùn)行庫(kù)的強(qiáng)大功能相結(jié)合。

10余年的八步網(wǎng)站建設(shè)經(jīng)驗(yàn),針對(duì)設(shè)計(jì)、前端、開發(fā)、售后、文案、推廣等六對(duì)一服務(wù),響應(yīng)快,48小時(shí)及時(shí)工作處理。成都全網(wǎng)營(yíng)銷的優(yōu)勢(shì)是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動(dòng)調(diào)整八步建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無(wú)論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計(jì),從而大程度地提升瀏覽體驗(yàn)。創(chuàng)新互聯(lián)從事“八步網(wǎng)站設(shè)計(jì)”,“八步網(wǎng)站推廣”以來(lái),每個(gè)客戶項(xiàng)目都認(rèn)真落實(shí)執(zhí)行。

vb.net 如何獲取當(dāng)前系統(tǒng)的CPU使用率

使用wmi

類“Win32_Processor”中LoadPercentage屬性為當(dāng)前的cpu使用率

示例代碼: Private Sub Timer1_Timer()

Dim WMI服務(wù) As Object

Dim 對(duì)象 As Object

Dim 子對(duì)象 As Object

Dim 電腦名 As String

Dim 刷新 As Long

刷新 = 0

電腦名 = "." '表示本地計(jì)算機(jī)

Set WMI服務(wù) = GetObject("winmgmts://" 電腦名 "/root/cimv2")

Set 對(duì)象 = WMI服務(wù).InstancesOf("Win32_Processor")

Me.CurrentX = 0

Me.CurrentY = 0

For Each 子對(duì)象 In 對(duì)象

If 刷新 = 0 Then

刷新 = 1

Me.Cls

End If

Me.Print 子對(duì)象.Name "[" 子對(duì)象.CurrentClockSpeed "Hz] 使用率:" _

子對(duì)象.LoadPercentage "%"

Next

End Sub

VB.NET怎么編程測(cè)試CPU電壓

'

'!!!重要:首先要添加“引用”一個(gè)dll,選擇“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編號(hào)

Dim?[MyClass]?As?New?ManagementClass("Win32_Processor")

Dim?MyCollection?As?ManagementObjectCollection?=?[MyClass].GetInstances()

Dim?MyInfo?As?String?=?"當(dāng)前系統(tǒng)CPU編號(hào)是:"

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)

'獲取計(jì)算機(jī)CPU的當(dāng)前電壓

Dim?MyInfo?As?String?=?"計(jì)算機(jī)CPU的當(dāng)前電壓是:"

Dim?MySearcher?As?New?ManagementObjectSearcher("SELECT?*?FROM?Win32_Processor")

For?Each?MyObject?As?ManagementObject?In?MySearcher.Get()

Try

MyInfo?=?ControlChars.Lf??String.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)

'獲取計(jì)算機(jī)CPU的外部頻率

Dim?MyInfo?As?String?=?"計(jì)算機(jī)CPU的外部頻率是:"

Dim?MySearcher?As?New?ManagementObjectSearcher("SELECT?*?FROM?Win32_Processor")

For?Each?MyObject?As?ManagementObject?In?MySearcher.Get()

Try

MyInfo?=?ControlChars.Lf??String.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)

'獲取計(jì)算機(jī)CPU的二級(jí)緩存

Dim?MyInfo?As?String?=?"計(jì)算機(jī)CPU的二級(jí)緩存尺寸是:"

Dim?MySearcher?As?New?ManagementObjectSearcher("SELECT?*?FROM?Win32_Processor")

For?Each?MyObject?As?ManagementObject?In?MySearcher.Get()

MyInfo?=?ControlChars.Lf??String.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)

'獲取計(jì)算機(jī)CPU的制造商名稱

Dim?MyInfo?As?String?=?"計(jì)算機(jī)CPU的制造商名稱是:"

Dim?MySearcher?As?New?ManagementObjectSearcher("SELECT?*?FROM?Win32_Processor")

For?Each?MyObject?As?ManagementObject?In?MySearcher.Get()

MyInfo?=?ControlChars.Lf??String.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)

'獲取計(jì)算機(jī)CPU的產(chǎn)品名稱

Dim?MyInfo?As?String?=?"計(jì)算機(jī)CPU的產(chǎn)品名稱是:"

Dim?MySearcher?As?New?ManagementObjectSearcher("SELECT?*?FROM?Win32_Processor")

For?Each?MyObject?As?ManagementObject?In?MySearcher.Get()

MyInfo?=?ControlChars.Lf??String.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)

'獲取計(jì)算機(jī)CPU的版本信息

Dim?MyInfo?As?String?=?"計(jì)算機(jī)CPU的版本信息如下:"

Dim?MySearcher?As?New?ManagementObjectSearcher("SELECT?*?FROM?Win32_Processor")

For?Each?MyObject?As?ManagementObject?In?MySearcher.Get()

MyInfo?=?ControlChars.Lf??String.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)

'獲取計(jì)算機(jī)CPU的當(dāng)前使用百分比?注意要把SQLserver或者其他耗CPU的軟件開著否則看不到效果就一直為0

Dim?MyInfo?As?String?=?"計(jì)算機(jī)CPU的當(dāng)前使用百分比是:"

Dim?MySearcher?As?New?ManagementObjectSearcher("SELECT?*?FROM?Win32_Processor")

For?Each?MyObject?As?ManagementObject?In?MySearcher.Get()

MyInfo?=?ControlChars.Lf??String.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)

'獲取計(jì)算機(jī)CPU的最大時(shí)鐘頻率

Dim?MyInfo?As?String?=?"計(jì)算機(jī)CPU的最大時(shí)鐘頻率是:"

Dim?MySearcher?As?New?ManagementObjectSearcher("SELECT?*?FROM?Win32_Processor")

For?Each?MyObject?As?ManagementObject?In?MySearcher.Get()

MyInfo?=?ControlChars.Lf??String.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)

'獲取計(jì)算機(jī)CPU的當(dāng)前時(shí)鐘頻率

Dim?MyInfo?As?String?=?"計(jì)算機(jī)CPU的當(dāng)前時(shí)鐘頻率是:"

Dim?MySearcher?As?New?ManagementObjectSearcher("SELECT?*?FROM?Win32_Processor")

For?Each?MyObject?As?ManagementObject?In?MySearcher.Get()

MyInfo?=?ControlChars.Lf??String.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)

'獲取計(jì)算機(jī)的CPU地址寬度

Dim?MyInfo?As?String?=?"當(dāng)前計(jì)算機(jī)的CPU地址寬度是:"

Dim?MySearcher?As?New?ManagementObjectSearcher("SELECT?*?FROM?Win32_Processor")

For?Each?MyObject?As?ManagementObject?In?MySearcher.Get()

MyInfo?=?ControlChars.Lf??String.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)

'獲取計(jì)算機(jī)的CPU數(shù)據(jù)寬度

Dim?MyInfo?As?String?=?"當(dāng)前計(jì)算機(jī)的CPU數(shù)據(jù)寬度是:"

Dim?MySearcher?As?New?ManagementObjectSearcher("SELECT?*?FROM?Win32_Processor")

For?Each?MyObject?As?ManagementObject?In?MySearcher.Get()

MyInfo?=?ControlChars.Lf??String.Format("DataWidth?:?"??MyObject("DataWidth").ToString())

MyInfo?=?ControlChars.Lf??"========================================================="

Next?MyObject

MessageBox.Show(MyInfo,?"信息提示",?MessageBoxButtons.OK,?MessageBoxIcon.Information)

End?Sub

End?Class

vb.net如何獲取當(dāng)前進(jìn)程的cpu和內(nèi)存使用率?

使用wmi

類“Win32_Processor”中LoadPercentage屬性為當(dāng)前的cpu使用率

示例代碼: Private Sub Timer1_Timer()

Dim WMI服務(wù) As Object

Dim 對(duì)象 As Object

Dim 子對(duì)象 As Object

Dim 電腦名 As String

Dim 刷新 As Long

刷新 = 0

電腦名 = "." '表示本地計(jì)算機(jī)

Set WMI服務(wù) = GetObject("winmgmts://" 電腦名 "/root/cimv2")

Set 對(duì)象 = WMI服務(wù).InstancesOf("Win32_Processor")

Me.CurrentX = 0

Me.CurrentY = 0

For Each 子對(duì)象 In 對(duì)象

If 刷新 = 0 Then

刷新 = 1

Me.Cls

End If

Me.Print 子對(duì)象.Name "[" 子對(duì)象.CurrentClockSpeed "Hz] 使用率:" _

子對(duì)象.LoadPercentage "%"

Next

End Sub

新聞名稱:vb.net中用cpu vb和vb net
本文URL:http://m.newbst.com/article30/hjpspo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供搜索引擎優(yōu)化虛擬主機(jī)網(wǎng)站設(shè)計(jì)自適應(yīng)網(wǎng)站域名注冊(cè)用戶體驗(yàn)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

搜索引擎優(yōu)化