Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determine Board/PC Serial #
Message
De
07/05/2003 11:54:12
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00785597
Message ID:
00785861
Vues:
9
I use the hard disk drive serial number. Some of my clients have no NIC cards, yes it's true. And several have multiple NICS. Here is what I use to return a unique 6 digit number:
******************
** zGetHDDSerial
**
**	returns the last 6 digits of the HDD serial number.
LOCAL lcCurDrive, lcHDD, lcValue1
lcCurDrive=SUBSTR(SYS(5),1,1) && return current hard drive letter 'c'

**	return the hard drive serial number
ofs=create('scripting.filesystemobject')
lcHDD=ALLTRIM(STR(abs(ofs.drives(lcCurDrive).serialnumber)))
**	get the last 6 digits or pad with '0' if less than 6.
IF LEN(lcHDD)<6
	lcHDD=PADR(lcHDD,6,'0')
ELSE
	lcHDD=UPPER(SUBSTR(lcHDD,(LEN(lcHDD)-5),6))
ENDIF
return lcHDD
This can create an issue in multiple drive systems, but you could tie it to just c: or just the windows drive if you like.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform