Results 1 to 3 of 3

Thread: how to get the serial number of a hard disk trough vb6

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2003
    Posts
    3

    Unhappy how to get the serial number of a hard disk trough vb6


  2. #2
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051
    You can use the filesystemobject to get the serial number of a HD. Do a search on this forum for examples.

    I'll continue searching for your other problem.
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    VB Code:
    1. 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
    2.  
    3. Public Function GetSerialNumber() As Long
    4.  
    5.     Dim strVolumeBuffer As String
    6.     Dim strSysName As String
    7.     Dim lngSerialNumber As Long
    8.     Dim lngSysFlags As Long
    9.     Dim lngComponentLen As Long
    10.     Dim lngResult As Long
    11.    
    12.     strVolumeBuffer$ = String$(256, 0)
    13.     strSysName$ = String$(256, 0)
    14.     lngResult = GetVolumeInformation("C:\", strVolumeBuffer$, 255, lngSerialNumber, _
    15.             lngComponentLen, lngSysFlags, strSysName$, 255)
    16.                  
    17.     GetSerialNumber = lngSerialNumber
    18.    
    19. End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width