Question: I am writing an application in Visual Basic that pulls basic information about the computer and outputs the data onto a form. Currently, I am trying to pull the serial number for the machine I would be using. For example, pulling a serial number of a laptop from the BIOS. I have looked around the internet and haven't really found how to do this in Visual Basic without using WMI or C. Is there a way to do this in Visual Basic?

Below is what I have currently in the form, so you can get an idea of what I am trying to do:

```
        TextBoxComputerName.Text = Environment.MachineName
        TextBoxOSVersion.Text = System.Environment.OSVersion.ToString
        TextBoxOSFullName.Text = My.Computer.Info.OSFullName
        TextBoxCurrentUser.Text = System.Environment.UserName
        TextBox64Bit.Text = System.Environment.Is64BitOperatingSystem
        TextBoxSystemDirectory.Text = System.Environment.SystemDirectory
        TextBoxDomain.Text = System.Environment.UserDomainName
        ' CHECK SERIAL NUMBER HERE.

```

Thank you all so much!

Answer: 
Try to use Treek's Licecnsing Library. It has class for generating hardware serial.

<http://msdn.treekslicensinglibrary.com/html/f2bfa10c-d5d9-25ac-39c2-46e2393c0fbe.htm>
Here is a class that will return:
\*) Computer Name
\*) Assembly Name
\*) Login User Name
\*) Serial No

Imports System.Management

''' 
''' Provides the Methods and Properties to retrieve and make available to the
''' Application the:
''' \*) Computer Name
''' \*) Assembly Name
''' \*) Login User Name
''' \*) PC Serial Number
'''  

''' 
Public Class clsGetComputerInformation
Private ReadOnly mstrClsTitle As String = "clsGetComputerInformation"

```
Public ReadOnly Property pstrComputerName() As String
    Get
        Return Environment.MachineName
    End Get
End Property

Public ReadOnly Property pstrUserName() As String
    Get
        Return System.Security.Principal.WindowsIdentity.GetCurrent.Name
    End Get
End Property

Public ReadOnly Property pstrAssemblyName() As String
    Get
        Return My.Application.Info.AssemblyName
    End Get
End Property

Public Function pstrSystemSerialNumber() As String
    Dim query As New SelectQuery("Win32_bios")
    Dim search As New ManagementObjectSearcher(query)
    Dim info As ManagementObject
    Dim lstrSerialNo As String = ""

    For Each info In search.Get()
        lstrSerialNo = info("SerialNumber").ToString()
    Next
    Return lstrSerialNo
End Function

```

End Class