Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleLearn the number of CPUs on the system in Visual Basic 2005
DescriptionThis example shows how to learn the number of CPUs on the system in Visual Basic 2005.
KeywordsCPU usage, CPU load, PerformanceCounter, VB.NET
CategoriesVB.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
 
 
Copyright © 1997-2006 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated