A
awen7b
Unregistered / Unconfirmed
GUEST, unregistred user!
D7和D6中IdHTTP使用用什么区别?请教高手!
自定义函数如下:
Function TFrmServer.qbcz(qqhm,qbhm:string):string;
var
putstrs:tstrings;
putstr,getstr:string;
getstr1:TStringStream;
begin
putstr:=mer_id;
putstr:=putstr+'&uin=';
putstr:=putstr+qqhm+'&coin=';
putstr:=putstr+qbhm+'&';
putstr:=putstr+qbhm+'&type=88';
putstrs:=TStringList.Create ;
putstrs.Add(putstr);
Memo3.Lines.Add('向网站发送->:'+putstr);
Try
getstr:=putstrs.GetText;
getstr1:=TStringStream.Create('');
Try
idhttp.Post(urlstr,putstrs,getstr1);
qbcz:=getstr1.DataString;
Finally
getstr1.Free;
end;
Finally
putstrs.Free;
end;
end;
此函数用于D6时,能返回正确结果,用于D7时一律返回错误结果;具体查看了urlstr,putstrs的值,完全一致(即提交值一致,得到结果不一致),所以我觉得是控件设置问题,在此请教下高手,谢谢!
自定义函数如下:
Function TFrmServer.qbcz(qqhm,qbhm:string):string;
var
putstrs:tstrings;
putstr,getstr:string;
getstr1:TStringStream;
begin
putstr:=mer_id;
putstr:=putstr+'&uin=';
putstr:=putstr+qqhm+'&coin=';
putstr:=putstr+qbhm+'&';
putstr:=putstr+qbhm+'&type=88';
putstrs:=TStringList.Create ;
putstrs.Add(putstr);
Memo3.Lines.Add('向网站发送->:'+putstr);
Try
getstr:=putstrs.GetText;
getstr1:=TStringStream.Create('');
Try
idhttp.Post(urlstr,putstrs,getstr1);
qbcz:=getstr1.DataString;
Finally
getstr1.Free;
end;
Finally
putstrs.Free;
end;
end;
此函数用于D6时,能返回正确结果,用于D7时一律返回错误结果;具体查看了urlstr,putstrs的值,完全一致(即提交值一致,得到结果不一致),所以我觉得是控件设置问题,在此请教下高手,谢谢!