你用DriveComboBox1的ItemCount不就知道了吗?
解决方案 »
- 怎么改变treeview树形控件的某个节点颜色?请各路大侠帮忙?
- 菜鸟急救:关于系统进程的问题
- 怎么去查看LIB文件中的内容!
- 用delphixe如何写sql server2008可调用的dll
- fastreport中如何分组?(每5条分组)
- windows messanger and master volume?
- 一个奇怪的问题,用update语句更新数据库,adoquery.ExecSQL需要执行两次,数据库中的数据才能更新,为什么?
- delphi有没有象PB那样的在线帮助?
- 简直是太简单了 分值虽然少但这不是白送分么!
- 用ENTER切换焦点的问题。
- 点对点传文件的问题,我笨所以我送分!
- 在Delphi中使用flash控件
sum= 0;
for dr='A' to 'Z' do begin
if(GetDriverType(dr+':') <> DRIVER_UNKNOW)
Inc(sum);
end;Sum 就是驱动器数window最多支持26个驱动器a..z具体参见api GetDriverType
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;