Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HDD Serial number
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00259700
Message ID:
00265741
Vues:
22
Can this routine be used to get the drive serial number of a file server's drive? Our data is located on a dedicated NT machine. All PC workstations are connected to it via Windows '95 LAN. I tried substituting our server's name for "C" in the example, but the value returned was "0000-0000".

Thanks.

>
>
>*--
>*   Store Volume information in the passed array.
>*
>*     1- Volume Name
>*     2- Volume Serial (numeric)
>*     3- Volume Serial (hexadecimal string)
>*
>*   Parameters
>*
>*     pcDrive - Drive Letter of the drive to get information.
>*     paDriveinfo - Variable passed by reference.
>*                   It is dimensioned as an 3 element array.
>*   Example :
>*
>*     Local aVolinfo
>*     GetVolInfo("C", @aVolinfo)
>*     ? aVolInfo(3)     && serial number in hex. format.
>*--
>
>PROCEDURE GetVolInfo
>    LParam pcDrive, paDriveInfo
>
>    Declare Integer GetVolumeInformation In Win32API ;
>            String @, String @, Integer, Integer  ;
>            @, Integer @, Integer @, String @, Integer
>
>    Local LcDrive, LcHex
>    Local Lcroot, Lcvolbuffer, Lnvolsize, Lnvolsernum
>    Local Lnmaxlen, Lnfsflags, Lcfsnmbuff, Lnfsnmsz
>
>    Lcdrive = Upper(Left(Ltrim(pcDrive), 1))
>    Lcroot = Lcdrive+":\"
>
>    Lnvolsize = 260
>    Lnfsnmsz  = 260
>    Lcvolbuffer = Replicate(chr(0),260)
>    Lcfsnmbuff = Replicate(chr(0),260)
>
>    Lnmaxlen = 0
>    Lnvolsernum = 0
>    Lnfsflags = 0
>
>    Lnerror = GetVolumeInformation(@Lcroot,@Lcvolbuffer, Lnvolsize, ;
>              @Lnvolsernum, @Lnmaxlen,@Lnfsflags, @Lcfsnmbuff, Lnfsnmsz)
>
>    IF Lnvolsernum < 0
>       Lnvolsernum = 0xFFFFFFFF + Lnvolsernum + 1
>    Endif
>    LcHex = Right(Transform(Lnvolsernum, '@0'),8)
>
>    If type('paDriveinfo(1)')='U' .or. ALen(paDriveInfo,1)<3
>       Dimension paDriveinfo(3)
>    Endif
>
>    paDriveInfo(1) = Left(Lcvolbuffer, At(Chr(0), Lcvolbuffer) -1)
>    paDriveInfo(2) = Lnvolsernum
>    paDriveInfo(3) = Left(lcHex,4)+'-'+Right(lcHex, 4)
>
>Endproc
>
>
>
>
>>Hello all,
>>
>>Do you no program, command or function to get serial number of the HardDrive?
>>
>>Also... a good Encryption function.
>>
>>Any suggest, comment, URL are welcome....
>>
>>Tkx.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform