发信人: redfox (Z掉了几乎所有的版...), 信区: BorlandDev
标 题: Delphi编程 -- 3.5 驱动器容量
发信站: 哈工大紫丁香 (2000年09月01日13:52:09 星期五), 站内信件
驱动器容量
要得到驱动器的容量和剩余容量,用下面的程序
var
driver:pchar;
sec1, byt1, cl1, cl2:longword;
begin
driver:='c:\';//要显示的驱动器名
GetDiskFreeSpace(driver, sec1, byt1, cl1, cl2);
cl1 := cl1 * sec1 * byt1;
cl2 := cl2 * sec1 * byt1;
Label1.Caption := '该驱动器总共容量' + Formatfloat('###,##0',cl2) + '字
节';
Label2.Caption := '该驱动器可用容量' + Formatfloat('###,##0',cl1) + '字
节';
end;
--
※ 来源:·哈工大紫丁香 bbs.hit.edu.cn·[FROM: 202.118.227.107]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.981毫秒