Online Shopping : Computers : Programming : Languages : Visual basic

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

151 of 195 people (77%) answered Yes
Recently 7 of 10 people (70%) answered Yes

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")