各位大虾帮帮忙,小D先谢过了!

Sir_Java 2003-10-20 01:44:18
怎样将一个磁盘中的所有文件及文件夹显示在一个ListView控件中,包括图标,即实现类似资源管理器中右边窗口的功能?
请详细说明,最好有一段代码为例,我是菜鸟!分不是问题!
...全文
30 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
Sir_Java 2003-10-21
  • 打赏
  • 举报
回复
我要用的是ListView控件!
superlionet 2003-10-20
  • 打赏
  • 举报
回复
delphi5 中没有吗?那就用delphi6 或者在win31页里用filelistbox,directorylistbox,drivecombobox组合使用,也应该可以达到你想要的结果的。
Sir_Java 2003-10-20
  • 打赏
  • 举报
回复
ShellTreeView、ShellComboBox这两个组件在D5里面可以用吗?如果可以,这两个控件在何处可以下载到?
Sir_Java 2003-10-20
  • 打赏
  • 举报
回复
不好意思,我用的是D5!Samples页面没有你们所说的控件,
我的邮箱地址是:xazhengyuning@163.com!
谢谢各位了!
hansome 2003-10-20
  • 打赏
  • 举报
回复
在面板的Samples页
有个 ShellListView 组件非常适合你
还有相关的
ShellTreeView、ShellComboBox组件

使用起来非常方便和简单
pankun 2003-10-20
  • 打赏
  • 举报
回复
转:

查找所有文件
procedure findall(disk,path: String; var fileresult: Tstrings);
var

fpath: String;

fs: TsearchRec;

begin

fpath:=disk+path+'\*.*';

if findfirst(fpath,faAnyFile,fs)=0 then

begin

if (fs.Name<>'.')and(fs.Name<>'..') then

if (fs.Attr and faDirectory)=faDirectory then

findall(disk,path+'\'+fs.Name,fileresult)

else

fileresult.add(disk+strpas(strupper(pchar(path)))+'\'+strpas(

strupper(pchar(fs.Name)))+'('+inttostr(fs.Size)+')');

while findnext(fs)=0 do

begin

if (fs.Name<>'.')and(fs.Name<>'..') then

if (fs.Attr and faDirectory)=faDirectory then

findall(disk,path+'\'+fs.Name,fileresult)

else

fileresult.add(disk+strpas(strupper(pchar(path)))+'\'+str

pas(strupper(pchar(fs.Name)))+'('+inttostr(fs.Size)+')');

end;

end;

findclose(fs);

end;

procedure DoSearchFile(Path: string; Files: TStrings = nil);

var

Info: TSearchRec;

procedure ProcessAFile(FileName: string);

begin

if Assigned(PnlPanel) then

PnlPanel.Caption := FileName;

Label2.Caption := FileName;

end;

function IsDir: Boolean;

begin

with Info do

Result := (Name <> '.') and (Name <> '..') and ((attr and fadirectory) = fadirectory);

end;

function IsFile: Boolean;

begin

Result := not ((Info.Attr and faDirectory) = faDirectory);

end;

begin

Path := IncludeTrailingBackslash(Path);

try

if FindFirst(Path + '*.*', faAnyFile, Info) = 0 then

if IsFile then

ProcessAFile(Path + Info.Name)

else if IsDir then DoSearchFile(Path + Info.Name);

while FindNext(Info) = 0 do

begin

if IsDir then

DoSearchFile(Path + Info.Name)

else if IsFile then

ProcessAFile(Path + Info.Name);

Application.ProcessMessages;

if QuitFlag then Break;

Sleep(100);

end;

finally

FindClose(Info);

end;

end;

 

lincanwen 2003-10-20
  • 打赏
  • 举报
回复
看看 Samples中的ShellListView控件,应该可以满足你的要求。
EastBuBai 2003-10-20
  • 打赏
  • 举报
回复
给我留个地址我给你发个程序吧
Delphi_Li 2003-10-20
  • 打赏
  • 举报
回复
你看看Delphi提供的源代码!!!
你想当“李逍遥”式的“大侠”吗? 这里无需计算机基础,无需编程经验,你也不必是计算机专业的在校大学生....只要爱好游戏,怀揣梦想! 有一定自主学习能力,跟着刘老师从“编程小白”修炼为游戏研发“大虾”吧!!!学习好Unity,其先决条件是一定要有稳固、扎实的编程基础!课程 《C# For Unity系列之入门篇》配套学习资料链接:http://pan.baidu.com/s/1gflxreN 密码:sou5;刘老师讲Unity学员群(2) 497429806一、热更新系列(技术含量:中高级):A:《lua热更新技术中级篇》https://edu.csdn.net/course/detail/27087B:《热更新框架设计之Xlua基础视频课程》https://edu.csdn.net/course/detail/27110C:《热更新框架设计之热更流程与热补丁技术》https://edu.csdn.net/course/detail/27118D:《热更新框架设计之客户端热更框架(上)》https://edu.csdn.net/course/detail/27132E:《热更新框架设计之客户端热更框架(中)》https://edu.csdn.net/course/detail/27135F:《热更新框架设计之客户端热更框架(下)》https://edu.csdn.net/course/detail/27136二:框架设计系列(技术含量:中级): A:《游戏UI界面框架设计系列视频课程》https://edu.csdn.net/course/detail/27142B:《Unity客户端框架设计PureMVC篇视频课程(上)》https://edu.csdn.net/course/detail/27172C:《Unity客户端框架设计PureMVC篇视频课程(下)》https://edu.csdn.net/course/detail/27173D:《AssetBundle框架设计_框架篇视频课程》https://edu.csdn.net/course/detail/27169三、Unity脚本从入门到精通(技术含量:初级)A:《C# For Unity系列之入门篇》https://edu.csdn.net/course/detail/4560B:《C# For Unity系列之基础篇》https://edu.csdn.net/course/detail/4595C: 《C# For Unity系列之中级篇》https://edu.csdn.net/course/detail/24422D:《C# For Unity系列之进阶篇》https://edu.csdn.net/course/detail/24465四、虚拟现实(VR)与增强现实(AR):(技术含量:初级)A:《虚拟现实之汽车仿真模拟系统 》https://edu.csdn.net/course/detail/26618五、Unity基础课程系列(技术含量:初级) A:《台球游戏与FlappyBirds—Unity快速入门系列视频课程(第1部)》 https://edu.csdn.net/course/detail/24643B:《太空射击与移动端发布技术-Unity快速入门系列视频课程(第2部)》https://edu.csdn.net/course/detail/24645 C:《Unity ECS(二) 小试牛刀》https://edu.csdn.net/course/detail/27096六、Unity ARPG课程(技术含量:初中级):A:《MMOARPG地下守护神_单机版实战视频课程(上部)》https://edu.csdn.net/course/detail/24965B:《MMOARPG地下守护神_单机版实战视频课程(中部)》https://edu.csdn.net/course/detail/24968C:《MMOARPG地下守护神_单机版实战视频课程(下部)》https://edu.csdn.net/course/detail/24979

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧