1,593
社区成员
发帖
与我相关
我的任务
分享
procedure TForm1.Button1Click(Sender: TObject);
var
HTML: String;
IdHTTP1: TIdHTTP;
begin
HTML := '';
try
IdHTTP1:= TIdHTTP.Create(nil);
IDHttp1.HandleRedirects := true;
IdHTTP1.request.contenttype:='application/x-www-form-urlencoded';
try
//HTML := IdHTTP1.Get('http://xxxxx.com/b.html'); //这个可以正常获取
HTML := IdHTTP1.Get('C:\b.html'); //这个报错
HTML := UTF8Decode(HTML);
except
end;
finally
IdHTTP1.Free;
end;
Application.MessageBox(pchar(HTML),'提示',0)
end;