以下程序中,button1.click获取代码出错,button2.click则正常.不知是网站的原因还是什么?unit Unit1;interfaceuses
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.
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.
解决方案 »
- 在一个treeview的node没有子节点了,该node有超链接功能
- 用delphi写一个web报表的插件,在asp调用,给个建议如何去做
- 用TAdoDataSet如何使用单字匹配符过滤数据,就像是Filter:='MyField like ''MyVal_%''' 一样,但好像不行,它不能把_当作一个单字匹配符
- 关于这个问题,请各位告知小弟!!!在线等待!!!
- 用Database Destop 建立数据表的问题?
- intraweb 中使用TQuery组件的问题
- 再问一个关于Ole和Word的奇怪问题,在线等待!!!
- 请问有穷举QQ的程序吗?
- 怎把小数四舍五入保留两位小数
- 一个很菜但困扰了我几天的问题
- 班主: '0 '.. '9 ':; 怎么跟新版本变成这样子
- 关于报表的问题
procedure TForm1.Button2Click(Sender: TObject);
var
myidhttp1:Tidhttp;
begin
myIDHttp1:=Tidhttp.Create(nil);
myIDHttp1.request.UserAgent:='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; MyIE2; CustomExchangeBrowser; .NET CLR 1.1.4322)';
memo2.Text:=myIDHttp1.Get( 'http://result.lottery.gov.cn/qxcpl3.js ');
end;end.