Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
About Harddisk Serial Number
Message
De
26/09/2002 04:21:18
 
 
À
26/09/2002 03:56:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00704582
Message ID:
00704584
Vues:
25
Hi
I found a VB sample code for it.. you may need to convert it to vfp code or compiled the vb code as DLL and call it from vfp.
Private Declare Function GetVolumeInformation& Lib "kernel32" _
    Alias "GetVolumeInformationA" (ByVal lpRootPathName _
    As String, ByVal pVolumeNameBuffer As String, ByVal _
    nVolumeNameSize As Long, lpVolumeSerialNumber As Long, _
    lpMaximumComponentLength As Long, lpFileSystemFlags As _
    Long, ByVal lpFileSystemNameBuffer As String, ByVal _
    nFileSystemNameSize As Long)
    Const MAX_FILENAME_LEN = 256


Private Sub Command1_Click()
    Label1.Caption = SerNum("C") 'C is the standard harddisk
End Sub


Public Function SerNum(Drive$) As Long
    Dim No&, s As String * MAX_FILENAME_LEN
    Call GetVolumeInformation(Drive + ":\", s, MAX_FILENAME_LEN, _
    No, 0&, 0&, s, MAX_FILENAME_LEN)
    SerNum = No
End Function
HTH
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform