I've done things others recommended to get TDownloadURL
working.
I finally boiled it all down to a form with a TButton
, a TEdit
, and a TMemo
. Click the button to download the URL and display in the TMemo.
I get an error message:
Error Downloading URL
And weirdly, the ampersands in the URL are absent in the error message.
This is in Delphi 10.
Here is the entirety of the program code:
procedure TForm1.Button1Click(Sender: TObject);
VAR tmpname, tmpUrl : String;
begin
Memo1.Clear;
tmpName := 'E:\Borland Studio Projects\TryPhish\temp.tmp';
Edit1.Text := 'http://www.phishtank.com/phish_search.php?page=1&active=y&valid=u&Search=Search';
tmpUrl := Edit1.Text;
WITH TDownloadURL.Create(nil) DO
try
URL := tmpUrl;
filename := tmpName;
try
ExecuteTarget(self);
Memo1.Lines.LoadFromFile(tmpName);
DeleteFile(tmpName);
except
ON E:Exception DO
ShowMessage(E.Message);
end;
finally
Free;
end;
end;
I used to know all this, but 10+ years of hardly doing any coding have taken their toll...