procedure TForm1.getdriveinfo; //查看驱动器信息
var
d:dword;
i:byte;
s,sd:string;
la,lb,p:int64;
begin
s:='本机中的逻辑驱动器有:'+#10;
d:=getlogicaldrives;
for i:=0 to 25 do begin
if ((d shr i) and 1=1) then begin
sd:=chr(i+ord('A'));
s:=s+sd+'--';
if i<2 then s:=s+'软盘驱动器'+#10
else begin
case GetDriveType(pchar(sd+':\')) of
0: s:=s+'驱动器形式不能确定';
1: s:=s+'根目录不存在';
2: s:=s+'可移动的驱动器';
3: s:=s+'硬盘驱动器';
4: s:=s+'远程(网络)驱动器';
5: s:=s+'CD-ROM驱动器';
6: s:=s+'虚拟驱动器';
end;
if disksize(i+1)<>-1 then
if GetDiskFreeSpaceex(PChar(sd+':\'),la,lb,@p)=true then
s:=s+' 容量为'+FormatFloat('###,##0',lb)
+' 剩余空间为'+FormatFloat('###,##0',la)
+#10;
if disksize(i+1)=-1 then s:=s+' 驱动器没准备好'+#10;
end;
end;
end;
//send('driveinfo'+s);
end;
var
d:dword;
i:byte;
s,sd:string;
la,lb,p:int64;
begin
s:='本机中的逻辑驱动器有:'+#10;
d:=getlogicaldrives;
for i:=0 to 25 do begin
if ((d shr i) and 1=1) then begin
sd:=chr(i+ord('A'));
s:=s+sd+'--';
if i<2 then s:=s+'软盘驱动器'+#10
else begin
case GetDriveType(pchar(sd+':\')) of
0: s:=s+'驱动器形式不能确定';
1: s:=s+'根目录不存在';
2: s:=s+'可移动的驱动器';
3: s:=s+'硬盘驱动器';
4: s:=s+'远程(网络)驱动器';
5: s:=s+'CD-ROM驱动器';
6: s:=s+'虚拟驱动器';
end;
if disksize(i+1)<>-1 then
if GetDiskFreeSpaceex(PChar(sd+':\'),la,lb,@p)=true then
s:=s+' 容量为'+FormatFloat('###,##0',lb)
+' 剩余空间为'+FormatFloat('###,##0',la)
+#10;
if disksize(i+1)=-1 then s:=s+' 驱动器没准备好'+#10;
end;
end;
end;
//send('driveinfo'+s);
end;
解决方案 »
- 怎样设置ColorComboBox只显示某些颜色呢?
- 请教一个试用软件实现的问题
- 请教:如何调用webbrowser显示的网页中的函数??
- 数据库里面类似于cg20040921001的单号要怎么增加呢?
- 急用,关于ping,在线等
- 急!!!
- 怎么把日期转换为如20030508
- 小弟刚学Fastreport,请教一个用Fastreport的主从表例子。在线等待,解决即得分。
- 谁知道在dbgrideh中直接点击title就可按点击的那个字段排序的方法?不盛感激!
- 这里有没有南京高新软件园的朋友?
- 50分,一个奇怪的问题,动态创建窗体的时候就不能使用adoquery.不创建就可以
- 为何在Delphi6(up2)、ADO2.6(sp1)、Win2000(sp2)、Ms SQL Server2k下会出现("Either Eof or Bof is true...ERROR!"), 特急,请帮我!!!!!!
struct dfree diskinfo;
long disk_space;
getdfree(3,&diskinfo);
disk_space=(long) diskinfo.df_avail*(long) diskinfo.df_bsec* (long) diskinfo.df_sclus;