用FindFirst,FindNext不是更好吗?
解决方案 »
- delphi 很简单的写代码是的问题
- 请教一个问题,关于webbrowser和idhttp
- 怎么让Delphi支持APNG
- fastreport中动态创建series
- 我想在listview中上移或下移当前选中的条目,该如何来做?
- 有一个表,字段a:整数,现在要用locate语句编写查询a>5同时a<7的纪录,该如何编写
- 请问windows时如何识别进程已经死掉了?
- 如何判断指定文件正在被其他进程打开或判断该文件没有被其他进程打开?
- 我也装了DELPHI6,这控件越来越多,都有用处吗?我越学越没信心了!
- 程序員還有活路嗎?!
- d6的程序程序编译后程序在其他机器上缺少qtinft.dll,如何在编译时加入?
- 在客户端与服务器端连接时出现错误.如何解决?最好给出关键步骤.
var
FindFileData : TWin32FindData;
SearchHandle : THandle;
folder,files : WideString;
temp : String;
begin
SetCurrentDirectory(PChar(path));
searchhandle:=findfirstfile('*.*',findfiledata);
if (SearchHandle <> INVALID_HANDLE_VALUE) then
repeat
if ((findfiledata.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY)<>0) then
begin
temp:=findfiledata.cFileName;
if ((temp<>('.')) and (temp<>('..'))) then
folder:=folder+findfiledata.cFileName+'\';
end else
begin
files:=files+findfiledata.cFileName+'/';
end; until (FindNextFile(SearchHandle,FindFileData) = FALSE) else begin
files:='无';
folder:='无'
end;
Windows.FindClose(SearchHandle);end;
可能是有效的,但我并不需要。我只要Filesystemobject 对象怎样
访问一个目录下的所有目录和文件
这个 olevariant 只能用字符吗?
我可不可以用 integer代替啊,
var
dvs: Drives;
dv: Drive;for i := 0 to dvs.Count - 1 do
begin
dv := dvs.Item[i];
// do your things;
end;注意:我参考了MSDN,写了上述代码,具体细节也许会有出入。
for i:=1 to Fld.SubFolders.Count do
begin
fld.subfolders.item[这个参数是olevariant].name
end;
我用fld.subfolders.item[i].name 包参数错误,这个参数怎么可以
和i结合起来用,或还有什么办法,我不要把哪个控件拖过来隐藏起来用
for i := 0 to fid.subflders.count -1 do
fid.subfolders.item[i].name
驱动器是'C;'那个ITEM['windows']就不会报错啦
嗬嗬,还有别的办法可以解决吗?