casa

Forum: "Principale";
Archivio attuale: 2002.01.08;
Scarica: [xml.tar.bz2];
giù

Come? Trova rami simili


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 = XNUMX do with SearchRec do begin
if (Attr and faDirectory<>XNUMX) 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);
iniziare
// что хочем то и делаем с файлом
fine;

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

iniziare
if FindFirst(DirFrom+"\*.*",faAnyFile,SearchRecOtkuda) = XNUMX then
iniziare
if (faDirectory and SearchRecOtkuda.Attr) > XNUMX then
ReadDir(SearchRecOtkuda.Name)
altro
ReadFile(SearchRecOtkuda.Name);
while FindNext(SearchRecOtkuda) = XNUMX do
iniziare
if (faDirectory and SearchRecOtkuda.Attr) > XNUMX then
ReadDir(SearchRecOtkuda.Name)
altro
ReadFile(SearchRecOtkuda.Name);
fine;
fine;
fine;



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

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





Pagine: 1 tutto il ramo

Forum: "Principale";
Archivio attuale: 2002.01.08;
Scarica: [xml.tar.bz2];

al piano di sopra

Top.Mail.Ru Yandeks.Metrika













Memoria: 0.77 MB
Ora: 0.04 c
1-22231
Leviathan
XNUMX-XNUMX-XNUMX XNUMX:XNUMX
2002.01.08
BitBlt...


6-22285
Vitale
XNUMX-XNUMX-XNUMX XNUMX:XNUMX
2002.01.08
Problema di scelta


3-21905
nic406
XNUMX-XNUMX-XNUMX XNUMX:XNUMX
2002.01.08
Help! Делаю Select * From TXNUMX -> refresh -> ошибка(ADODataSet)


3-21928
kaif
XNUMX-XNUMX-XNUMX XNUMX:XNUMX
2002.01.08
arithmetic overflow or string truncation при Restore


1-22108
Michael
XNUMX-XNUMX-XNUMX XNUMX:XNUMX
2002.01.08
Stampa lunga su stampante a matrice





afrikaans albanese Arabic armeno Azero basco bielorusso Bulgarian catalano Cinese (semplificato) Cinese (tradizionale) croato Ceco danese Dutch Inglese estone filippina Finnish Francese
galiziano georgiano Tedesco greco Creolo haitiano ebraico hindi ungherese islandese Indonesian irlandese Italiano Giapponese Korean lettone lituano macedone Malay maltese Norwegian
persiano polacco Portoghese rumeno Russian serbo Slovak sloveno Spagnolo swahili Swedish Thai turco ucraino Urdu vietnamita gallese yiddish bengalese bosniaco
Cebuano esperanto Gujarati Hausa Hmong Igbo giavanese kannada khmer lao latino maori marathi mongolo nepali punjabi somalo tamil telugu Yoruba
zulù
Английский Francese tedesco italiano portoghese russo spagnolo