Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Such a thing is Hardware Ser_No?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 7
Network:
Windows NT
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01607065
Message ID:
01607072
Vues:
61
>>In an effort to implement some sort of copy protection, I am currently registering the Computer Name
>>(using SYS(0) or GETENV() functions).. But that's kind of rudimentary. It can easily be changed.
>>
>>Is there a better way in VFP to retrieve some sort of Hardware or Windows Serial number?
>>I will even settle for Network WorkGroup, or anything else that's unique for a given computer.
>>
>>Thanks.
>
>
>Here is some code which I got from someone here on the UT which gets the hard disk serial number (the 3rd array item has the serial number):
>
>
>CLEAR
>?
>
>PUBLIC TARRAY
>DECLARE TARRAY(10)
>
>TARRAY = ""
>
>=GETVOLINFO( "c:\", @TARRAY )
>
>FOR I = 1 TO ALEN( TARRAY )
>  ? TARRAY(I)
>NEXT
>
>
>
>Function GetVolInfo
>
>Lparameters lcRoot, taInfo && Root of drive ie: "c:\", InfoArray passed by ref
>
>Declare SHORT GetVolumeInformation IN Win32API;
>  STRING @lpRootPathName, STRING @lpVolumeNameBuffer,;
>  INTEGER nVolumeNameSize, integer @lpVolumeSerialNumber,;
>  INTEGER @lpMaximumComponentLength, INTEGER @lpFileSystemFlags,;
>  STRING @lpFileSystemNameBuffer, INTEGER nFileSystemNameSize
>
>Store 0 TO lncomplen, lnsysflags, lnserialno
>Store SPACE(260) TO lcvolname, lcsysname
>Store LEN(lcvolname) TO lnvolsize, lnnamesize
>
>If (GetVolumeInformation(@lcRoot, @lcvolname,;
>    lnvolsize, @lnserialno, @lncomplen, @lnsysflags,;
>    @lcsysname, lnnamesize) # 0)
>
>  Dimension taInfo[3]
>
>  taInfo[1] = substr(lcvolname, 1, at(chr(0),lcvolname)-1) && Volume name
>  taInfo[2] = substr(lcsysname, 1, at(chr(0),lcsysname)-1) && Par.type
>  taInfo[3] = trans(right(trans(iif(lnSerialNo < 0, 0x7FFFFFFF-abs(lnSerialNo)+0x7FFFFFFF, lnSerialNo),'@0'),8) ) && Serial  
>
>Else
>
>  taInfo = ""
>
>Endif
>
>Return
>
The volume serial number can be changed easily right within windows. Better to get the physical serial number of the harddisk instead.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform