FUNCTION GetVolumeNumber( lcVolume ) *------------------------------------------------------------ * Description: GetVolumeNumber - Get the unique number associated with the boot hard drive. * Parameters: lcVolume, The hard drive drive letter. * Return: HDD Identifier. * Use: *------------------------------------------------------------ LOCAL lcFileSystemName, lcVolumeName, lnFileSystemFlags, lnFileSystemNameLen, ; lnMaxFileNameLen, lnVolumeNameLen, lnVolumeSerialNumber #DEFINE ccNULL CHR(0) #DEFINE cnFS_CASE_SENSITIVE 0 #DEFINE cnFS_CASE_IS_PRESERVED 1 #DEFINE cnFS_UNICODE_STORED_ON_DISK 2 #DEFINE cnFS_PERSISTENT_ACLS 3 #DEFINE cnFS_FILE_COMPRESSION 4 #DEFINE cnFS_VOL_IS_COMPRESSED 15 * Declare the API function and constants. DECLARE GetVolumeInformation IN Win32API ; STRING lpRootPathName, STRING @lpVolumeNameBuffer, ; INTEGER nVolumeNameSize, INTEGER @lpVolumeSerialNumber, ; INTEGER @lpMaximumComponentLength, INTEGER @lpFileSystemFlags, ; STRING @lpFileSystemNameBuffer, INTEGER nFileSystemNameSize lcVolumeName = SPACE(255) lnVolumeNameLen = LEN(lcVolumeName) lnVolumeSerialNumber = 0 lnMaxFileNameLen = 0 lnFileSystemFlags = 0 lcFileSystemName = SPACE(255) lnFileSystemNameLen = LEN(lcFileSystemName) GetVolumeInformation(lcVolume, @lcVolumeName, lnVolumeNameLen, ; @lnVolumeSerialNumber, @lnMaxFileNameLen, @lnFileSystemFlags, ; @lcFileSystemName, lnFileSystemNameLen) RETURN lnVolumeSerialNumber ENDFUNC>
FUNCTION GetMotherBoardSerialNumber() LOCAL lcNumber, loboard, locolboard, loloc, loproperty, lowmi loloc = CREATEOBJECT('WbemScripting.SWbemLocator') lowmi = loloc.ConnectServer() lcNumber = "" locolboard = lowmi.InstancesOf('Win32_Baseboard') FOR EACH loboard IN locolboard FOR EACH loproperty IN loboard.Properties_ IF INLIST(UPPER(loproperty.NAME),'SERIALNUMBER') THEN lcNumber = loproperty.VALUE EXIT ENDIF loproperty = .NULL. ENDFOR loboard = .NULL. IF NOT EMPTY(lcNumber) EXIT ENDIF ENDFOR RETURN lcNumber ENDFUNC>thanks