|
|
Title | Learn the number of CPUs on the system in Visual Basic 2005 |
Description | This example shows how to learn the number of CPUs on the system in Visual Basic 2005. |
Keywords | CPU usage, CPU load, PerformanceCounter, VB.NET |
Categories | VB.NET, Windows, Software Engineering |
|
|
When it starts, the program simply checks the Environment object's ProcessorCount property.
|
|
Private Sub Form1_Load(ByVal sender As System.Object, ByVal _
e As System.EventArgs) Handles MyBase.Load
If Environment.ProcessorCount = 1 Then
lblNumProcessors.Text = "1 processor"
Else
lblNumProcessors.Text = _
Environment.ProcessorCount.ToString() & " " & _
"processors"
End If
End Sub
|
|
|
|
|
|