孤独的猫

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

procedure GetDiskInfo(var TotalSize,FreeSize:Integer;Disk:string); //单位为兆(M)

var

freespace,totalspace:int64;

begin

if (Pos('\',TrimRight(Disk)<>Length(Disk) then

Disk :=Disk+'\';

GetDiskFreeSpaceEx(pchar(Disk),freespace,totalspace,nil);

TotalSize :=totalspace div 1024 div 1024;

freesize:=freespace div 1024 div 1024;

end;

//例如: GetDiskInfo(totalspace,freespace,'C:\');

posted on 2008-09-14 14:09  孤独的猫  阅读(137)  评论(0编辑  收藏  举报