Get System Information Using WMI in VB.NET

Category:
C#, VB.NET, ASP.NET
Type:
Classes
Difficulty:
Beginning
Author:
Intelligent Solutions Inc.

Version Compatibility: Visual Basic.NET

More information:
This class shows you how to use WMI to get some basic system information in .NET. It demonstrates only a small subset of the features within WMI. You must include a reference to system.management to use it. Below is a sample of how to use the class:
     Dim objWMI As New clsWMI()
With objWMI
      Debug.WriteLine("Computer Name = " & .ComputerName)
      Debug.WriteLine("Computer Manufacturer = " & .Manufacturer)
      Debug.WriteLine("Computer Model = " & .Model)
      Debug.WriteLine("OS Name = " & .OsName)
      Debug.WriteLine("OS Version = " & .OSVersion)
      Debug.WriteLine("System Type = " & .SystemType)
      Debug.WriteLine("Total Physical Memory = " & .TotalPhysicalMemory)
      Debug.WriteLine("Windows Directory = " & .WindowsDirectory)
End With

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: