另外,磁盘分区的大小会不会有变化(除了重新分区的情况)〉??

解决方案 »

  1.   

    Returns the size, in bytes, of a specified drive.UnitSysUtilsCategoryfile management routinesDelphi syntax:function DiskSize(Drive: Byte): Int64;C++ syntax:extern PACKAGE __int64 __fastcall DiskSize(Byte Drive);DescriptionDiskSize returns the size in bytes of the specified drive, where 0 = Current, 1 = A, 2 = B, etc. DiskSize returns -1 if the drive number is invalid.Note: DiskSize is only available on Windows.This example uses a form with a label on it. When the following code executes, it displays a message in the label indicating the number of KB free, and what percentage of the entire disk space that represents.var  S: string;
      AmtFree: Int64;
      Total:   Int64;
    begin
      AmtFree := DiskFree(0);
      Total := DiskSize(0);
      S := IntToStr(AmtFree div Total) + 'percent of the space on drive 0 is free: ' (AmtFree div 1024) + ' Kbytes free. ';
      Label1.Caption := S;
    end;
    一般不重新分区,分区大小不会改变.
      

  2.   

    非常感谢:madyak(无天) 另外还有一些疑问:这个函数是否适用于所有windows os(XP、2k);
    scsi硬盘呢??fat32以及ntfs的都适用么??