* Basic Volume information
* 获取盘区信息
* 红雨
*----------------------------
Clea
#Define FILE_CASE_SENSITIVE_SEARCH 1
#Define FILE_CASE_PRESERVED_NAMES 2
#Define FILE_UNICODE_ON_DISK 4
#Define FILE_PERSISTENT_ACLS 8
#Define FILE_FILE_COMPRESSION 16
#Define FILE_VOLUME_IS_COMPRESSED 32768 && &H8000
Declare INTEGER GetLastError IN kernel32
Declare SHORT GetVolumeInformation IN kernel32;
STRING lpRootPathName,;
STRING @ lpVolumeNameBuffer,;
INTEGER nVolumeNameSize,;
INTEGER @ lpVolumeSerialNumber,;
INTEGER @ lpMaximumComponentLength,;
INTEGER @ lpFlags,;
STRING @ lpFileSystemNameBuffer,;
INTEGER nFileSystemNameSize
lpRootPathName = "C:\" && 驱动器和目录名
lpVolumeNameBuffer = SPACE(256) && lpVolumeName 返回缓存
nVolumeNameSize = 256 && lpVolumeNameBuffer 的大小
lpVolumeSerialNumber = 0 && lpVolumeSerialNumber 缓存
lpMaximumComponentLength = 256
lpFileSystemFlags = 0
lpFileSystemNameBuffer = SPACE(256)
nFileSystemNameSize = 256
lnResult = GetVolumeInformation(@lpRootPathName, @lpVolumeNameBuffer, ;
nVolumeNameSize, @lpVolumeSerialNumber, ;
@lpMaximumComponentLength, @lpFileSystemFlags, ;
@lpFileSystemNameBuffer, nFileSystemNameSize)
If lnResult = 1
?"驱动器和目录名 : " + ALLTRIM(lpRootPathName)
?"卷名 : " + LEFT(ALLTRIM(lpVolumeNameBuffer),LEN(ALLTRIM(lpVolumeNameBuffer))-1)
?"卷名最大字符数 : " + ALLTRIM(STR(nVolumeNameSize))
?"卷序列号 : " + ALLTRIM(STR(lpVolumeSerialNumber))
?"文件/目录名的最大字符数 : " + ALLTRIM(STR(lpMaximumComponentLength))
?"文件系统标记 : " + ALLTRIM(STR(lpFileSystemFlags))
?"文件系统类型 : " + LEFT(ALLTRIM(lpFileSystemNameBuffer), LEN(ALLTRIM(lpFileSystemNameBuffer))-1)
?"文件系统名大小 : " + ALLTRIM(STR(nFileSystemNameSize))
Else
? "运行错误号: ", GetLastError()
Endif
Clea dlls
Retu
我用以上得到的卷序列号为:-195799120,而用DOS下的DIR命令得到的十六进制的序列号为F454-57B0,转换为十进制后两者不相同,请各位老师指教!