Hard Drive Serial Number? 
Author Message
 Hard Drive Serial Number?

I'm trying to retrieve the Hard Drive
Serial Number from my VB application.

I would like to know if anybody know how to do so.
It would be great it I can get some source code if not all,
and if it is possible not to jump to dos and would be able to
access in both NT/9x.

Thanks,

Johnny Lai



Wed, 27 Dec 2000 03:00:00 GMT  
 Hard Drive Serial Number?

?I'm trying to retrieve the Hard Drive
?Serial Number from my VB application.
?
?I would like to know if anybody know how to do so.
?It would be great it I can get some source code if not all,
?and if it is possible not to jump to dos and would be able to
?access in both NT/9x.

The following code works fine for me:

Private Declare Function GetVolumeInformation Lib "kernel32" Alias _
   "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal _
   lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, _
   lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, _
   lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String,
_
   ByVal nFileSystemNameSize As Long) As Long

Private Sub Form_Load()

Dim nRet As Long
Dim VolName As String
Dim VolSN As Long
Dim sVolSN As String
Dim MaxCompLen As Long
Dim VolFlags As Long
Dim VolFileSys As String

VolName = Space$(256)
VolFileSys = Space$(256)
nRet = GetVolumeInformation("C:\", VolName, Len(VolName), VolSN, _
   MaxCompLen, VolFlags, VolFileSys, Len(VolFileSys))
sVolSN = Hex(VolSN)

End Sub

Paul
~~~~



Wed, 27 Dec 2000 03:00:00 GMT  
 Hard Drive Serial Number?
  That returns the 4 byte ID for a specific HD partician or volume. It's the
same listed by the DOS's VOL command and changes every time a volume is
formatted. I wonder if he is trying to get some kind of unique manufacturing
code from the hardware instead.
Quote:

>Hope this will help.

>--
>//          Antonino Sabetta



>> I'm trying to retrieve the Hard Drive
>> Serial Number from my VB application.

>> I would like to know if anybody know how to do so.
>> It would be great it I can get some source code if not all,
>> and if it is possible not to jump to dos and would be able to
>> access in both NT/9x.

>> Thanks,

>> Johnny Lai



Sat, 06 Jan 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Hard Drive Serial Number/Total Drive Size

2. hard drive serial number

3. Reading the Hard Drives Serial Number

4. Hard Drive Serial Number

5. Hard drive serial number

6. Getting Hard Drive Serial number

7. API call for hard drive serial number

8. Hard Drive Serial Numbers

9. Hard Drive Serial Numbers

10. Get hard drive serial numbers

11. Hard drive serial number

12. Hard Drive Volume Serial Number

 

 
Powered by phpBB® Forum Software