Display Bios Information in VB.NET
Submitted by donbermoy on Tuesday, May 26, 2015 - 21:13.
Today, I will teach you how to create a program that can display the hardware information of the BIOS using VB.NET.
Now, let's start this tutorial!
1. Let's start with creating a Windows Form Application for this tutorial by following the following steps in Microsoft Visual Studio: Go to File, click New Project, and choose Windows Application.
2. Next, add a TabControl and a DataGridView Only. You must design your interface like this:
3. Now, we will do the coding.
First we will create a vb module named globals.
We will have to create public sub procedure named addRow that will add rows to the DataGridView.
And will add the column names using a function named getStructure()
4. Then now, we will code for our Form_Load, put this code below:
Import first the System.Management library.
And with this in the Form_Load.
Download the source code and try it.
For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below.
Best Regards,
Engr. Lyndon Bermoy
IT Instructor/System Developer/Android Developer/Freelance Programmer
Mobile: 09488225971
Landline: 826-9296
E-mail:[email protected]
Add and Follow me on Facebook: https://www.facebook.com/donzzsky
Visit and like my page on Facebook at: https://www.facebook.com/BermzISware

- Public Sub addRow(ByRef dt As DataTable, ByVal p As String, ByVal v As String)
- Dim dr As DataRow
- dr = dt.NewRow
- dr("Property") = p
- dr("Value") = v
- dt.Rows.Add(dr)
- End Sub
- Public Function getStructure() As DataTable
- Dim dt As New DataTable
- dt.Columns.Add(New DataColumn("Property"))
- dt.Columns.Add(New DataColumn("Value"))
- Return dt
- End Function
- Imports System.Management
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Try
- Dim searcher As New ManagementObjectSearcher( _
- "root\CIMV2", _
- "SELECT * FROM Win32_BIOS")
- Dim dt As DataTable = globals.getStructure
- For Each queryObj As ManagementObject In searcher.Get()
- If queryObj("BIOSVersion") Is Nothing Then
- globals.addRow(dt, "BIOSVersion", queryObj("BIOSVersion"))
- Else
- Dim arrBIOSVersion As String()
- arrBIOSVersion = queryObj("BIOSVersion")
- For Each arrValue As String In arrBIOSVersion
- globals.addRow(dt, "BIOSVersion", arrValue)
- Next
- End If
- globals.addRow(dt, "CurrentLanguage", queryObj("CurrentLanguage"))
- globals.addRow(dt, "Description", queryObj("Description"))
- globals.addRow(dt, "Manufacturer", queryObj("Manufacturer"))
- globals.addRow(dt, "PrimaryBIOS", queryObj("PrimaryBIOS"))
- globals.addRow(dt, "ReleaseDate", queryObj("ReleaseDate"))
- Next
- Me.DataGridView1.DataSource = dt
- Catch err As ManagementException
- MessageBox.Show("An error occurred while querying for WMI data: " & err.Message)
- End Try
- End Sub
Output:

Add new comment
- 731 views