How can I get the serial (or other) number of my hard drive through VB 
Author Message
 How can I get the serial (or other) number of my hard drive through VB

GET VOLUME SERIAL NUMBER FROM FLOPPIES VB4 32-bit

Option Explicit
Private Declare Function GetVolumeInformation& Lib "kernel32" _
Alias "GetVolumeInformationA" _
(ByVal sRootPathName As String, _
ByVal sVolumeNameBuffer As String, _
ByVal lVolumeNameSize As Long, _
lVolumeSerialNumber As Long, _
lMaximumComponentLength As Long, _
lFileSystemFlags As Long, _
ByVal sFileSystemNameBuffer As String, _
ByVal lFileSystemNameSize As Long)

Public Function GetSerialNumber(sDrive As String) As String

Dim lDiskSerialNumber As Long
Dim lDummy1 As Long
Dim lDummy2 As Long
Dim sSerialTemp As String

sDrive = Trim$(sDrive)

If Len(sDrive) = 0 Then Exit Function

sDrive = Left$(sDrive, 1) & ":"
Call GetVolumeInformation(sDrive, String(255, 0), 255,
lDiskSerialNumber, lDummy1, lDummy2, String(255, 0), 255)

sSerialTemp = "" + Hex(lDiskSerialNumber)
GetSerialNumber = Left$(sSerialTemp, 4) & "-"

& Right$(sSerialTemp, 4)

Debug.Print " " & GetSerialNumber

End Function

Private Sub Command1_Click()

label1.Caption = GetSerialNumber((Text1.Text))

End Sub

Code suggested by

--
HTH
delete "RemoveMe."



Quote:
> How can I get the serial (or other number) number of my hard drive
through
> VB



Sat, 21 Oct 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Getting Hard Drive Serial number

2. Hard Drive Serial Number/Total Drive Size

3. How can I get the serial (or other) number of my hard drive through VB

4. hard drive serial number

5. Reading the Hard Drives Serial Number

6. Hard Drive Serial Number

7. Hard Drive Volume Serial Number

8. Reading the hard drive's serial number

9. Hard drive serial number

10. API call for hard drive serial number

11. Hard Drive Serial Numbers

12. Hard Drive Serial Numbers

 

 
Powered by phpBB® Forum Software