by Rhian ASeniero (8 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 23rd April 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Getting the Serial Number of a Harddisk using API call.
API Declarations
Public Function GetSerial(str As String) As Long
Dim Buf$, Name$, Flags&, Length&
Dim Serial As Long
GetVolumeInformation str, Buf$, 255, Serial, Length, Flags, Name$, 255
GetSerial = Serial
End Function
label1.caption = GetSerial("C:\")