Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cpu id, NIC id, Motherboard ID,hard disk id
Message
De
31/03/2006 09:07:12
 
 
À
31/03/2006 08:49:06
Suhas Hegde
Dental Surgeon
Sirsi, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 6 SP5
Divers
Thread ID:
01109476
Message ID:
01109479
Vues:
48
>hi all,
>
>Is there any way to get cpu id, NIC id, Motherboard ID,hard disk id from VFP? or using free third party dlls ?
>
>any api calls to do the same ???

Here's some code that I picked up somewhere to get the disk ID
messagebox( DiskSerial())


FUNCTION DiskSerial

LPARAMETER cDisk

DECLARE SHORT GetVolumeInformation IN Win32API ;
        STRING wroot, ;
        STRING wnombuf, ;
        LONG wnomsize, ;
        STRING wnumero, ;
        STRING wmx, ;
        STRING wflag, ;
        STRING wsysbuf, ;
        INTEGER wsyssize

LOCAL wroot, wnombuf, wnumero, wmx
LOCAL wflag, wsysbuf, wnomsize, wsyssize
LOCAL n1,n2,n3,n4, w1,w2,w3,w4

wroot = IIF(EMPTY(cDisk), SYS(5), cDisk + ':') + "\" && disque courant
wnombuf = SPACE(255)
wnumero = SPACE(10)
wmx = SPACE(255)
wflag = SPACE(255)
wsysbuf = SPACE(255)
wnomsize = 255
wsyssize = 255

GetVolumeInformation (wroot, @wnombuf, @wnomsize, @wnumero, ;
                      @wmx, @wflag, @wsysbuf, @wsyssize)

*** récupérer la valeur numérique décimale de chaque c retourné
*** (en inversant car les c sont retournés dans l'ordre 4, 3, 2, 1)
n4 = ASC(SUBSTR(wnumero,1,1))
n3 = ASC(SUBSTR(wnumero,2,1))
n2 = ASC(SUBSTR(wnumero,3,1))
n1 = ASC(SUBSTR(wnumero,4,1))

*** transformer la valeur décimale en valeur hexadécimale
w1 = TRANSFORM(n1,'@0')
w2 = TRANSFORM(n2,'@0')
w3 = TRANSFORM(n3,'@0')
w4 = TRANSFORM(n4,'@0')


RETURN ;
	RIGHT(w1,2) +;
	RIGHT(w2,2) +;
	"-"         +;
	RIGHT(w3,2) +;
	RIGHT(w4,2)
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform