Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
New security issues with XP home edition
Message
De
20/07/2004 11:42:41
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00924836
Message ID:
00926130
Vues:
20
George,
First, i'd like to thank you for all your help, you've rescued me on more than one occassion now. My client tried your alternate code on the problem machine, here is his response:
"It worked. So, I feel this is a good workaround - whatever you did. It rended a valid ID and took the registration number."

As per your instruction I used:
******************
** zGetHDDSerial
**
**	returns the last 6 digits of the HDD serial number.
DECLARE SHORT GetVolumeInformation IN Win32API;
  STRING @lpRootPathName,;
  STRING @lpVolumeNameBuffer,;
  INTEGER nVolumeNameSize,;
  INTEGER @lpVolumeSerialNumber,;
  INTEGER @lpMaximumComponentLength,;
  INTEGER @lpFileSystemFlags,;
  STRING @lpFileSystemNameBuffer,;
  INTEGER nFileSystemNameSize
lproot = 'C:\'
lpVolName = SPACE(260)
lpVolSize = LEN(lpVolname)
lpVolSerial = 0
lpMaxComp = 0
lpFlags = 0
lpSysName = lpVolName
GetVolumeInformation(@lproot, @lpVolName,;
    lpVolSize, @lpVolSerial, @lpMaxComp,;
    @lpFlags, @lpSysName, lpVolSize)

LOCAL lcHDD
lcHDD=ALLTRIM(STR(lpVolSerial))




*!*	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 'x' if less than 6.
IF LEN(lcHDD)<6
	lcHDD=PADL(lcHDD,6,'X')
ELSE
	lcHDD=SUBSTR(lcHDD,(LEN(lcHDD)-5),6)
ENDIF
return lcHDD
Thanks for your help, it's greatly appreciated.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform