Swart Bob
Шрифт:
if FindFirst('*.htm', faArchive, SRec) = 0 then
repeat
Assign(f,SRec.Name);
Reset(f);
if IOResult = 0 then { no error }
while not eof(f) do
begin
readln(f,Str);
while (Pos('<A href="#"text_code"> (Pos('FRAME SRC="',Str) 0) do
begin
if Pos('<A href="#"text_code"> Delete(Str,1,Pos('href="#"text_code"> else
Delete(Str,1,Pos('FRAME SRC="',Str)+10);
if (Pos('#',Str) <> 1) and
(Pos('http://',Str) <> 1) and
(Pos('mailto:',Str) <> 1) and
(Pos('news:',Str) <> 1) and
(Pos('ftp://',Str) <> 1) and
(Pos('.exe?',Str) = 0) then { skip external links & exe }
begin
if Pos('file:///',Str) = 1 then Delete(Str,1,8);
if (Pos('#',Str) 0) and
(Pos('#',Str) < Pos('"',Str)) then Str[Pos('#',Str)] := '"';
if not FileExists(Copy(Str,1,Pos('"',Str)-1)) then
writeln(Path,'\',SRec.Name,': [',Copy(Str,1,Pos('"',Str)-1),']')
end
end
end;
Close(f);
if IOResult <> 0 then { skip }
until FindNext(SRec) <> 0;
FindClose(SRec);
// check sub-directories recursively
if FindFirst('*.*', faDirectory, SRec) = 0 then
repeat
if ((SRec.Attr AND faDirectory) = faDirectory) and
(SRec.Name[1] <> '.') then
begin
ChDir(SRec.Name);
CheckHTML(Path+'\'+SRec.Name);
ChDir('..')
end
until FindNext(SRec) <> 0;
FindClose(SRec)
end {CheckHTML};
begin
writeln('HTMLinks 4.0 (c) 1997-2000 by Bob Swart (aka Dr.Bob - www.drbob42.com)');
writeln;
FileMode := $40;
GetDir(0,Path);
CheckHTML(Path)
end.
3.4.4. FTP Upload/Download
Иногда вам просто нужно загружать файлы из Интернета. В терминах Интернета, это означает, что вам нужно использовать FTP клиента. И если вы не желаете, подобно мне использовать настоящего FTP клиента, то просто напишите, как и я своего собственного клиента…