You can use WMI to get that. At the end of this the sb will contain a comma delimited list of serial numbers. WMI can also tell you other properties about these drives. StringBuilder sb = new StringBuilder; ManagementClass diskDrives = new ManagementClass('Win32LogicalDisk'); ManagementObjectCollection disks = diskDrives.GetInstances. Hi dear how do to get serial number hard drive and mother bord in vb.net? Thanks Ok here it is Extract the zip, contains. This will work for you just great! First add reference to System.Management and then make sure to import it at the top of your class as well. I did this on a.
|
![How To Get Computer Serial Number In Vb.net How To Get Computer Serial Number In Vb.net](/uploads/1/2/6/2/126248096/707790149.png)
Definition
Gets an array of serial port names for the current computer.
Returns
An array of serial port names for the current computer.
Exceptions
![How To Get Computer Serial Number In Vb.net How To Get Computer Serial Number In Vb.net](/uploads/1/2/6/2/126248096/960436060.png)
The serial port names could not be queried.
Examples
The following code example uses the GetPortNames method to display serial port names to the console.
Remarks
The order of port names returned from GetPortNames is not specified.
Use the GetPortNames method to query the current computer for a list of valid serial port names. For example, you can use this method to determine whether COM1 and COM2 are valid serial ports for the current computer.
The port names are obtained from the system registry (for example, HKEY_LOCAL_MACHINEHARDWAREDEVICEMAPSERIALCOMM). If the registry contains stale or otherwise incorrect data then the GetPortNames method will return incorrect data.