- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
function tform1.ExistsFiles(path:string):boolean;
var
hfile:thandle;
fname:string;
WD:win32_find_dataA;
begin
result:=false;
if directoryexists(path)=false then
exit;
path:=includetrailingpathdelimiter(path);
hfile:=FindFirstFile(pchar(path+'*.*'),wd);
if hfile <> invalid_handle_value then
begin
repeat
fname:=string(wd.cFileName);
if (fname <> '.') and (fname <> '..') then
begin
if (wd.dwFileAttributes and file_attribute_directory <> 0) then
begin
if existsfiles(path+fname)=true then
begin
result:=true;
break;
end;
end
else
if ansilowercase(extractfileext(fname))='.txt' then
begin
result:=true;
break;
end;
end;
until findnextfile(hfile,wd) <> true;
windows.findclose(hfile);
end;
end;
Проверяем, есть ли в папке и ее подпапках текстовые документы...
Stertor 26.11.2013 13:58 # −5