merhaba ;
acilan sayfadaki gecerli adres linklerini program icinden alip memoya atmak istiyorum. nasil yapabilirim. yardim eden herkese tesekkur...
internet sayfasindaki adres linklerini alip memoya atma
Forum kuralları
Forum kurallarını okuyup, uyunuz!
Forum kurallarını okuyup, uyunuz!
forma bi buton ikide memo koy. istersen memo1 yerine string bi değişkende olur.
Kod: Tümünü seç
uses ....,IdHTTP;
Kod: Tümünü seç
procedure TForm1.Button1Click(Sender: TObject);
Var Browser: TIdHTTP;
i,bas,son:integer;
begin
memo1.Text:='';
memo2.Text:='';
Browser := TIdHTTP.Create(nil);
try
Memo1.Text := Browser.Get('http://www.delphiturkiye.com/dlinks.htm');
finally
Browser.Free;
end;
bas:=0;son:=0;
for i:= 1 to length(memo1.Text) do
begin
if copy(memo1.text,i,9) = '<a href="' then bas:=i;
if (bas<>0) and (copy(memo1.text,i,1) = '"') and (copy(memo1.text,i-1,2) <> '="')
then son:=i else son:=0;
if (bas<>0) and (son<>0) then
begin
memo2.Lines.Add(Copy(memo1.Text,bas+9,son-bas-10));
son:=0;bas:=0;
end;
end;
end;