获取网页源码socket error #10061
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'); //这个可以正常获取 [color=#FF0000]HTML := IdHTTP1.Get('C:\b.html');[/color] //这个报错 HTML := UTF8Decode(HTML); except end; finally IdHTTP1.Free; end; Application.MessageBox(pchar(HTML),'提示',0)end;