Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I get the serial number of a Processor or Hard di
Message
De
23/01/2001 01:24:41
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00466558
Message ID:
00467139
Vues:
14
>>I need to make sure our software is not copied to multiple hard disks. I will be writing away an encrypted number to be calculated from a computer's hard disk serial and or processor serial.
>>
>>Is there any API or DLL/FLL that can do that. I have tried GetVolumeInfo() but a volume serial can be changed or Ghosted.
>>
>>Any ideas about how to uniquely identify a machine?
>>
>>Bernard
>
>Hi Bernard,
>
>Check out File 1331 Serialno - Function to return serialno from harddrive. in Files section/WIN32API & others APIs
>
>The solutions which rely on serial numbers may not be very reliable or convenient for users. What if they upgrade the HDD or processor? The reliable solution is to use the dongle (however it might be not very convenient for users).


Thank you for your reply. As stated in my email, I had used the GetVolumeInformation() API. Unfortunately on some computers the serial is
> EEEE EEEE and this gives us a problem as VFP and the DECLARE DLL command cannot seem to handle these larger numbers.

I USE :

DECLARE INTEGER GetVolumeInformation In WIN32API ;
STRING@, STRING@, LONG,LONG@, LONG@,LONG@,STRING@,LONG

LOCAL cnn
cnn=0
pc1 = "C:\"+CHR(0)
pc2 = SPACE(100)+CHR(0)
pn3 = 100
pn4 = 0
pn5 = 0
pn6 = 0.0000
pc7 = SPACE(100)+CHR(0)
pn8 = 100
bb=GetVolumeInformation(@pc1,@pc2,pn3,@pn4,@pn5,@pn6,@pc7,pn8)

The serial number comes back in pn4 but on some computers the number is coming back in scientific notation like -1.66879e+9
and this is giving errors in the calculation.

The serial number I reffered to was that which each hard disk manufacturer has that many commercial System Info applications read and display, NOT the serial set by DOS on formatting that can be changed/Ghosted.

Any ideas?

Bernard
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform