Casa
Top.Mail.Ru Yandeks.Metrika
Fórum: "Principal";
Arquivo atual: 2002.01.08;
Download: [xml.tar.bz2];

Para baixo

Como? Encontre agências semelhantes


Xtorm   (2001-12-19 10:40) [0]

Как получить весь список файлов и папок допустим на диске с:\
только без помощи компонентов???



Bizon   (2001-12-19 10:46) [1]

Воспользуйся ф-ями FindFirst & FindNext



Dimka Maslov   (2001-12-19 10:52) [2]

procedure FindFiles(Path, Mask: string; List: TStrings; IncludeSubDir: Boolean = True);
var
SearchRec: TSearchRec;
FindResult: Integer;
begin
List.BeginUpdate;
try
Path:=IncludeTrailingBackSlash(Path);
FindResult:=FindFirst(Path+"*.*", faAnyFile, SearchRec);
try
while FindResult = 0 do with SearchRec do begin
if (Attr and faDirectory<>0) then begin
if IncludeSubDir and (Name<>"..") and (Name<>".")
then FindFiles(Path+Name, Mask, List, IncludeSubDir);
end else begin
if MatchesMask(Name, Mask) then List.Add(Path+Name);
end;
FindResult:=FindNext(SearchRec);
end;
finally
FindClose(SearchRec);
end;
finally
List.EndUpdate;
end;
end;



cpp   (2001-12-19 10:53) [3]

Вот и моих исходников можешь подстроить под себя

procedure ReadAllFiles(DirFrom : string);
var SearchRecOtkuda : TSearchRec;



procedure ReadFile(FileName : string);
começar
// что хочем то и делаем с файлом
end;

procedure ReadDir(DirName : string);
começar
// что хочем то и делаем с директорием
if (DirName <> ".") and (DirName <> "..") then
começar
ReadAllFiles(DirFrom+"\"+DirName);
end;
end;

começar
if FindFirst(DirFrom+"\*.*",faAnyFile,SearchRecOtkuda) = 0 then
começar
if (faDirectory and SearchRecOtkuda.Attr) > 0 then
ReadDir(SearchRecOtkuda.Name)
outro
ReadFile(SearchRecOtkuda.Name);
while FindNext(SearchRecOtkuda) = 0 do
começar
if (faDirectory and SearchRecOtkuda.Attr) > 0 then
ReadDir(SearchRecOtkuda.Name)
outro
ReadFile(SearchRecOtkuda.Name);
end;
end;
end;



Xtorm   (2001-12-19 11:39) [4]

СПАСИБО Всем все теперь работает!!!!



Страницы: 1 filial inteira

Fórum: "Principal";
Arquivo atual: 2002.01.08;
Download: [xml.tar.bz2];

em cima















Memória: 0.82 MB
Hora: 0.034 c
7-22449
Schummi
2001-09-15 07:45
2002.01.08
Избранное в Windows


1-22032
Socol
2001-12-18 10:01
2002.01.08
Монипуляция чисел.


14-22389
sudiv
2001-11-08 15:38
2002.01.08
CashFiesta


3-21943
Oleon
2001-12-05 10:54
2002.01.08
Como usar o TableLevel?


14-22378
moderador
2001-11-08 07:51
2002.01.08
>Merilin





afrikaans albanês Arabic armênio azerbaijano basco belarusian Bulgarian catalão Chinês simplificado) Chinês tradicional) croata checo dinamarquês Dutch Inglês estoniano filipino Finnish French
Galego georgiano German grego crioulo haitiano hebraico hindi húngaro islandês Indonesian irlandês Italian Japanese Korean letão lituano macedónio Malay maltês Norwegian
persa polonês Portuguese romeno Russian sérvio Slovak esloveno espanhol swahili sueco tailandês turco ucraniano urdu vietnamita galês ídiche bengali bósnio
cebuano esperanto gujarati hausa hmong igbo javanês kannada khmer lao latino maori marata mongol Nepali punjabi somali tâmil telugu yoruba
zulu
Английский francês Alemão Italiano Португальский russo Espanhol