Function get_diskserialno (driveid: char): String;
VAR
VoluMserialnumber: DWORD;
MaximumComponentlength: DWORD;
FileSystemflags: dword;
PS: PCHAR;
STRING;
DT: DWORD;
Begin
PS: = PCHAR (DRIVEID ': /');
GetVolumeInformation (PS, NIL, 0, @ VoluMserialNumber, MaximumComponentLength, FileSystemflags, NIL, 0);
DT: = GetDriveType (PS);
ST: = '';
Case DT of
0: st: = 'can not determined';
1: st: = 'disk not existsed';
Drive_removable: st: = 'removed';
DRIVE_FIXED: ST: = 'Fixed';
Drive_remote: st: = 'recote';
DRIVE_CDROM: ST: = 'CDROM';
DRIVE_RAMDISK: ST: = 'ramdisk';
END;
Result: = INTTOHEX (HiWord (VoluMserialNumber), 4) '-' INTTOHEX (Loword (VoluMserialNumber), 4) 'Type:' ST;
END;