delphi获取剩余磁盘空间

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

//单位MB

function getDiskFree(Drive: String): Int64;

var
 FreeBytes: Int64;
 TotalBytes: Int64;
begin
  if GetDiskFreeSpaceEx(Pchar(Drive),FreeBytes, TotalBytes, nil) then
  begin
  RESULT := FreeBytes;
  end
  else
  begin
   RESULT := 0;
  end;
  RESULT:=RESULT shr 20;
end;

转载于:https://my.oschina.net/jingshishengxu/blog/661587

你可能感兴趣的:(python)