转自万一老师的博客,网上有很多方法,均测试无效后有问题,测试这个方法是真正准确可行的:)
uses IdHTTP;
const Url = 'http://del.cnblogs.com';
procedure TForm1.Button1Click(Sender: TObject);
var
stream: TStringStream;
idHttpObj: TIdHTTP;
begin
stream := TStringStream.Create('', TEncoding.UTF8); //
idHttpObj := TIdHTTP.Create(nil);
idHttpObj.Get(Url, stream);
idHttpObj.Free;
Memo1.Text := stream.DataString;
stream.Free;
end;
转载于:https://www.cnblogs.com/Handll/archive/2012/01/07/2315772.html