用idhttp:uses IdHTTP;
function GetWebPage(const Url :string; IsUtf8 :Boolean = False):string;
var
idp :TIdHTTP;
begin
Result := ‘’;
idp := TIdHTTP.Create(Application);
try
idp.HandleRedirects := True;
idp.Request.UserAgent := ‘Mozilla/5.0’;
Result := idp.Get(Url);
if IsUtf8 then
Result := Utf8ToAnsi(Result);
finally
FreeAndNil(idp);
end;
end;
delphi获取网页地址URL连接地址文字
最新推荐文章于 2024-05-28 10:31:16 发布