首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

delphi用msxml 中的ixmlhttprequest发送参数到asp.net失败,该如何处理

2012-03-25 
delphi用msxml 中的ixmlhttprequest发送参数到asp.net失败我在delphi中用ixmlhttprequest来和asp.net的服

delphi用msxml 中的ixmlhttprequest发送参数到asp.net失败
我在delphi中用ixmlhttprequest来和asp.net的服务器端页面异步通信,结果在delphi端传送过去的参数,在asp.net端总是无法接收到,以下是代码.
1.delphi端:
  url:='http://localhost/default.aspx';//服务器url
  params:='cardid=123456&gun=1249';//要传送的参数

  xmlhttp:=CoXMLHTTPRequest.Create;
  xmlhttp.open('GET',url,false,EmptyParam,EmptyParam);
  xmlhttp.send(parms);//发送参数,但在服务器端接收不到.为何?我写的有错????谁给改正一下
  while not xmlhttp.readystate=4 do
  begin
  showmessage(inttostr(xmlhttp.readyState));
  end;

  showmessage(xmlhttp.responseText);
2.asp.net端
  request.querystring["cardid"]接收参数为null.是这iis配置问题???

[解决办法]
你这里是GET方式。直接

Delphi(Pascal) code
url:='http://localhost/default.aspx?cardid=123456&gun=1249';//服务器url  xmlhttp:=CoXMLHTTPRequest.Create;  xmlhttp.open('GET',url,false,EmptyParam,EmptyParam);  xmlhttp.send(VarEmpty);//发送参数,但在服务器端接收不到.为何?我写的有错????谁给改正一下  while not xmlhttp.readystate=4 do  begin  showmessage(inttostr(xmlhttp.readyState));  end;  showmessage(xmlhttp.responseText); 

热点排行