Entry
How can i get harddisk serial number using vb/asp & also how to get OSserial no.
Sep 21st, 2006 13:12
Milan KM, AJAY MAURYA,
'Simply call the following API in a Module
'-----------------------------------------
Public Declare Function GetVolumeSerialNumber Lib "kernel32"
Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal
lpVolumeNameBuffer As Long, ByVal nVolumeNameSize As Long,
lpVolumeSerialNumber As Long, ByVal lpMaximumComponentLength As Long,
ByVal lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As Long,
ByVal nFileSystemNameSize As Long) As Long
Public Function VolumeSerial(DriveLetter) As Long
Dim Serial As Long
Call GetVolumeSerialNumber(UCase(DriveLetter) & ":\", 0&, 0&,
Serial, 0&, 0&, 0&, 0&)
VolumeSerial = Serial
End Function
'Then put following command on the main form
'-------------------------------------------
MsgBox VolumeSerial("D")