How To Get Computer Serial Number In Vbnet

How To Get Computer Serial Number In Vbnet 5,0/5 8753 reviews

This example shows how to get disk information including serial number in VB.NET by using the GetVolumeInformation API function. Keywords disk, serial number, GetVolumeInformation, VB.NET. Neutraface font free download.

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. Ddex provider firebird install. Here you can learn how to do it fast and easy with vb.net Here is a copy of the function I used in this software: Public Function GetHDSerialNo(ByVal strDrive As String) As String 'Get HD Serial Number 'Ensure Valid Drive Letter Entered, Else, Default To C If strDrive = ' OrElse strDrive Is Nothing Then strDrive = 'C' End If Dim moHD As New ManagementObject('Win32_LogicalDisk.DeviceID='' + strDrive + ':'') 'Get Info moHD.[Get]() Return moHD('VolumeSerialNumber').ToString() End Function.

Computer

You should use WMI for this, specifically querying the. The property you want to get is DeviceID.' A sample WMI call in the context of a console application might look like this: Dim mos As New ManagementObjectSearcher('SELECT * FROM Win32_UsbController') For Each mo As ManagementObject In mos.Get() Console.WriteLine(mo.Properties.Item('DeviceID').Value) Next Console.ReadLine() You would need to add references to System.Management and System.Management.Instrumentation to use ManagementObjectSearcher and ManagementObject.