How To Get Computer Serial Number In Vbnet

How To Get Computer Serial Number In Vbnet Rating: 8,5/10 9959 reviews
How To Get Computer Serial Number In Vbnet

You are polling the wrong WMI class/hive. Of course Microsoft is the OS manufacturer; what you need is Win32_ComputerSystem: Imports System.Management cs = New ManagementObjectSearcher('SELECT * FROM Win32_ComputerSystem') For Each objMgmt In cs.Get _Manufacturer = objMgmt('manufacturer').ToString() _Model = objMgmt('model').ToString() _SystemType = objMgmt('systemtype').ToString _totalMem = objMgmt('totalphysicalmemory').ToString() Next Manufacturer will be something like 'Dell, Inc', Model comes out spot on with mine, but has been known to sometimes include internal sub model identifiers. System type comes back as 'x64-based PC' on mine.

I need the serial number or other device identifier (IP Address, etc,) of the. We need this because we have an application that uses the VB.net.

MS has a WMI query builder somewhere to help fnd and use the right query, though it generates very wordy code. Give this a try in a console application. Rpg maker vx ace modern tilesets free download for windows 10.

Just remember to add the System.Management reference to your project. You need to access the Win32_ComputerSystem not the Win32_OperatingSystem. Sub Main() Dim objCS As Management.ManagementObjectSearcher Dim manufacturerName As String 'objOS = New Management.ManagementObjectSearcher('SELECT * FROM Win32_OperatingSystem') objCS = New Management.ManagementObjectSearcher('SELECT * FROM Win32_ComputerSystem') For Each objMgmt In objCS.Get manufacturerName = objMgmt('manufacturer').ToString() Next Debug.WriteLine('Manufacturer: ' & manufacturerName) End Sub Hope it helps.