我的代码为什么会出错?(高分求解) (100分)

D

dcba

Unregistered / Unconfirmed
GUEST, unregistred user!
我的代码的功能就是向服务器发送一个GET请求
在窗体上有三个控件,一个是button1,一个是IdHTTP1,和Label1
代码如下,
procedure TForm1.Button1Click(Sender: TObject);
var
myip,URL:string;
begin
myip:='10.25.2.31';
IdHTTP1.Host:='members.3322.org';
IdHTTP1.Connect();
with IdHTTP1.Request do
begin
BasicAuthentication:=true;
UserName:='ccbb';
Password:='3322';
Host:='members.3322.org';
end;
URL:=' /dyndns/update?system=dyndns'
+'&hostname='
+ 'ccbb.3322.org'
+'&myip='
+myip
+'&wildcard=ON&offline=NO ';
Label1.Caption:=IdHTTP1.Get(URL);;
IdHTTP1.Disconnect;
end;
当第一次点击BUtton1时,运行正常,当再点一次的时候,就会出现Http错误请求(error400)
这是为什么?
谁能告诉我?
我用的是delphi7.0+winxp
 
var
myip,URL:string;
begin
myip:='10.25.2.31';
IdHTTP1.Host:='members.3322.org';
with IdHTTP1.Request do
begin
BasicAuthentication:=true;
UserName:='ccbb';
Password:='3322';
Host:='members.3322.org';
end;
URL:=' /dyndns/update?system=dyndns'
+'&hostname='
+ 'ccbb.3322.org'
+'&myip='
+myip
+'&wildcard=ON&offline=NO ';
Label1.Caption:=IdHTTP1.Get(URL);;
end;
 
CODEHUNTER你的代码和我的是一样问题
大写给代码的时候能不能先调试以下?
谢谢了
 
你的程序不对,看一下delphi自带的示例程序。
有关于 TIdHttp的。
 
谢谢给位讨论时间太久了
 
顶部