unit online;
interface
function weblesen(sURL :
string) : ansistring;
implementation
uses main,classes, sysutils, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdHTTP, IdAntiFreezeBase, IdAntiFreeze;
function weblesen(sURL :
string) : ansistring;
var sstream : Tstringstream;
httpcon : TIdHTTP;
antifreeze : TIdAntiFreeze;
begin
result := '
';
sstream := tstringstream.Create('
');
try
antifreeze := TIdAntiFreeze.Create(
nil);
httpcon := TIdHTTP.create;
antifreeze.Active := true;
HttpCon.Get(sURL,sstream);
result := utf8towidestring(sstream.DataString);
except
httpcon.Disconnect;
end;
antifreeze.Active := false;
freeandnil(httpcon);
freeandnil(antifreeze);
freeandnil(sstream);
end;
end.