How To Get Computer Serial Number In Vbnet

Computer

Imports System.Management Public Class Form1 Private Sub Form1_Load( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim HDD_Serial, MB_serial As String Dim hdd As New ManagementObjectSearcher( 'select * from Win32_DiskDrive') For Each hd In hdd. Get HDD_Serial = hd( 'SerialNumber') Next Dim mboard As New ManagementObjectSearcher( 'select * from Win32_BaseBoard') For Each mb In mboard.

Get MB_serial = mb( 'SerialNumber') Next End Sub End Class thank dear but there are errors in codes: Error 1 Type 'ManagementObjectSearcher' is not defined. C: Users Sh2007 Desktop hdd hdd Form1.vb 6 20 hdd Error 3 Statement cannot appear outside of a method body/multiline lambda. C: Users Sh2007 Desktop hdd hdd Form1.vb 9 5 hdd please help me. Private Sub Form7_Load(sender As Object, e As System.EventArgs) Handles Me.Load Dim HDD_Serial, MB_serial As String Dim hdd As New ManagementObjectSearcher( 'select * from Win32_DiskDrive') For Each hd In hdd. Cara membuat windows palsu menjadi asli. Get HDD_Serial = hd( 'SerialNumber') Next Dim mboard As New ManagementObjectSearcher( 'select * from Win32_BaseBoard') For Each mb In mboard. Get MB_serial = mb( 'SerialNumber') Next MsgBox(MB_serial) End Sub Please mark those posts as answer which answers your question. Faraz thanks dear for your help but HDD_Serial is empty please check and help me . Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click Dim Searcher_p As New ManagementObjectSearcher( 'root CIMV2', 'SELECT * FROM Win32_DiskDrive') For Each queryObj As ManagementObject In Searcher_p.

Vb.net - Find harddisc serial number A lot of times you need to get the serial number of the harddisc of the user for all kind of purpeses. Here you can learn how to do it fast and easy with vb.net.

Get() TextBox1.Text += (queryObj( 'SerialNumber').ToString.Trim) Next End Sub What is your main objective? What do you want to do with these serial number? (Maybe there are better options available ) Please mark those posts as answer which answers your question. Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click Dim Searcher_p As New ManagementObjectSearcher( 'root CIMV2', 'SELECT * FROM Win32_DiskDrive') For Each queryObj As ManagementObject In Searcher_p. Get() TextBox1.Text += (queryObj( 'SerialNumber').ToString.Trim) Next End Sub What is your main objective?

What do you want to do with these serial number? (Maybe there are better options available ) Please mark those posts as answer which answers your question. Faraz thanks dear please see the picture there is an error Name of Allah, Most Gracious, Most Merciful and He created the human. Imports System.Management Public Class Form1 Private Sub Button1_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim Searcher_P As New ManagementObjectSearcher( 'SELECT * FROM Win32_BaseBoard') For Each queryObj As ManagementObject In Searcher_P.

Get() MsgBox(queryObj( 'SerialNumber').ToString.Trim) Next End Sub Private Sub Button2_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim Searcher_p As New ManagementObjectSearcher( 'root CIMV2', 'SELECT * FROM Win32_DiskDrive') For Each queryObj As ManagementObject In Searcher_p. Get() TextBox1.Text += (queryObj( 'SerialNumber').ToString.Trim) Next End Sub Private Sub Button3_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim Searcher_P As New ManagementObjectSearcher( 'SELECT * FROM Win32_PhysicalMedia') For Each queryObj As ManagementObject In Searcher_P. Get() MsgBox(queryObj( 'SerialNumber').ToString.Trim) Next End Sub End Class Thanks Name of Allah, Most Gracious, Most Merciful and He created the human.

    Search