我想在combobox的下拉框中有计算机的所有硬盘分区,并且当我选择分区时,在listbox中显示该分区中的目录,如何实现呀?如果能给出源代码,不胜感激
解决方案 »
- 关于ADOquery局域网共享操作问题?
- C++转Pascal的问题?
- 请大家帮忙看看是什么错误,谢谢了!
- 求一条UPDATE语句,很容易的,解决立刻结贴!
- 免费iso软件下载站
- 如何控制一个Edit中不能同时拥有两个相同的字符(字符为“e”),Edit长度为10。
- 大家来谈谈——程序员的理想
- 哪有BMP的图标下
- 用delphi开发webservice服务器端如何定义全局对象
- 考考高手:如何获得正在运行的任意进程的application title?
- 一个比较复杂的问题,如何比较图象的不同。
- corba问题,为什么会出现"Class not found:Files\borland\vbroker\jre\bin\jre.exe"
var
x:integer;
drive:char;
y:integer;
begin
x:=0;
y:=0;
x:=GetLogicalDrives();
repeat
x:= x div 2 ;
Y:=Y+1;
until x=1;
x:=0;
for drive:='a' to 'z' do
begin
Case GetDriveType(pchar(Drive+':\')) of
2: Label1.Caption :='软盘驱动器';
3: Label1.Caption := '硬盘驱动器';
4: Label1.Caption := '网络驱动器';
5: Label1.Caption := 'CD-ROM驱动器';
6: Label1.Caption := '虚拟驱动器';
Else Label1.Caption := '驱动器无效';
end;
if GetDriveType(pchar(Drive+':\'))in[2,3,4,5,6] then
ComboBox1.Items.Add(pchar(drive+':\ ')+label1.Caption);
x:=x+1;
if x>y then begin
showmessage('Done !');
exit;
end;
end;
end;procedure TForm1.ComboBox1Change(Sender: TObject);var
SearchRec:TSearchRec;
ext,AppPath:string;
begin
listbox1.Items.Clear;
AppPath:=copy(combobox1.Items.Strings[combobox1.itemindex],1,3);
ext:='*.*';
FindFirst(AppPath+ext,faDirectory,SearchRec);
listbox1.Items.Add(SearchRec.Name);
while FindNext(SearchRec)=0 do
listbox1.Items.Add(SearchRec.Name);
end;
TShellTreeView
TShellListView