idhttp获取网页源文件出错,急求解决办法! ( 积分: 20 )

  • 主题发起人 主题发起人 ooooh
  • 开始时间 开始时间
O

ooooh

Unregistered / Unconfirmed
GUEST, unregistred user!
[blue]以下程序中,button1.click获取代码出错,button2.click则正常.不知是网站的原因还是什么? 以前是正常的,只是近一段时间才有的错误.[/blue]

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdHTTP, StdCtrls;

type
TForm1 = class(TForm)
Memo1: TMemo;
Memo2: TMemo;
Button1: TButton;
IdHTTP1: TIdHTTP;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
memo1.Text:=idhttp1.Get( 'http://www.zhcw.com/data-js/nowdata98.js ');
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
memo2.Text:=idhttp1.Get( 'http://result.lottery.gov.cn/qxcpl3.js ');
end;

end.
 

Similar threads

I
回复
0
查看
686
import
I
I
回复
0
查看
763
import
I
I
回复
0
查看
740
import
I
I
回复
0
查看
673
import
I
后退
顶部