C++ Builder6 运行通过asp.net能取得数据:
String tmpStr="Type=1&DeviceInfo=[("+Edit1->Text+"|"+Edit2->Text+")]";
TIdHTTP *TIdHTTP1=new TIdHTTP(this);
TStrings *Source=new TStringList();
TStringStream *stream=new TStringStream("");
Source->Add(tmpStr);
TIdHTTP1->Post("http://localhost/RemoteAddDevice.aspx",Source,stream);
Memo1->Text=stream->DataString;Delphi7,asp.net却不能取得数据:
var
Str,tmpStr:String;
tmpStrings:Source;
LResponse: stream;
begin
tmpStr:='Type=1&DeviceInfo=[('+Trim(Name.Text)+'|'+Trim(Pass.Text)+')]';
Source:=TStringlist.Create;
Source.Add(tmpStr);
stream:= TStringStream.Create('');
MainForm.IdHTTP1.Post('http://localhost/RemoteAddDevice.aspx',Source,stream);
Memo1.Text=:=stream.DataString;
end;头痛头痛啊~!~~~>_<~~~~
String tmpStr="Type=1&DeviceInfo=[("+Edit1->Text+"|"+Edit2->Text+")]";
TIdHTTP *TIdHTTP1=new TIdHTTP(this);
TStrings *Source=new TStringList();
TStringStream *stream=new TStringStream("");
Source->Add(tmpStr);
TIdHTTP1->Post("http://localhost/RemoteAddDevice.aspx",Source,stream);
Memo1->Text=stream->DataString;Delphi7,asp.net却不能取得数据:
var
Str,tmpStr:String;
tmpStrings:Source;
LResponse: stream;
begin
tmpStr:='Type=1&DeviceInfo=[('+Trim(Name.Text)+'|'+Trim(Pass.Text)+')]';
Source:=TStringlist.Create;
Source.Add(tmpStr);
stream:= TStringStream.Create('');
MainForm.IdHTTP1.Post('http://localhost/RemoteAddDevice.aspx',Source,stream);
Memo1.Text=:=stream.DataString;
end;头痛头痛啊~!~~~>_<~~~~
解决方案 »
- delphi操作数据库问题
- 程序在事件的循环中,未何无法结束程序
- 急,如何向Form 发窗体最大化和最小化的消息!!!!!
- 请问谁有shellplus的相关资料?
- 客户端向服务器提交数据(大概几千条或上万条),怎么知道它的进度?
- Form的OnKeyDown事件中方向键不响应 可能是什么原因
- vcl的使用问题不知道如何调用vcl的方法,把这个组件加入我的程序后
- adotable+access的dbgrid显示问题(附源码),高手来看看!!
- 阻塞模式下怎么接收数据?
- 在 win2000下,为什么我用movefileex()或movefile()把一个目录下的文件移动到另一个目录不行!急!
- ★★★马甲升星,散分★★★
- 数据过滤的问题。。。
Str,tmpStr:String;
tmpStrings:Source;
LResponse: stream;这是你的代码么?
在Delphi8下:
var
tmpStr:String;
Source,stream:TStringStream;
IdHTTP1:TIdHTTP;
begin
tmpStr:='Type=1&DeviceInfo=[(中文字|testpwd)]';
IdHTTP1:=TIdHTTP.Create(Form1);
Source:= TStringStream.Create(tmpStr);
stream:= TStringStream.Create('');
IdHTTP1.Post('http://localhost/WebApplication1/WebForm1.aspx',Source,stream);
Memo1.Text:=stream.DataString;WebForm1.aspx为:
Response.Write("Received"+Request.TotalBytes.ToString()+"TYPE:"+Request.Form["Type"]);-----------------------------------
运行用结果Request.TotalBytes居然为0!!!!!Delphi得回的结果是:"Received0TYPE:"
Post函数好像不起作用?!!!!!!
求教啊!:(
var
postList: TStrings;
begin
Edit1.Text := 'http://community.csdn.net/expert/forum.asp';
postList := TStringList.Create;
try
postList.Add('login_name=cronuz');
postList.Add('password=***');
memo1.Lines.Text := IdHTTP1.Post( Edit1.Text, postList );
finally
Edit1.Text := IdHTTP1.Response.Server+': '+IdHTTP1.Response.ResponseText;
postList.Free;
end;
end;説明:把在CSDN的登録名改成你的试试看
在AtoZed.Com的http://lysoft.7u7.net
感谢兄弟,但AtoZed.Com的Indy是正版的,要购买的!兄弟不是要我买正版吧?!我无钱啊!
:(
(小声说:有盗版的吗?:))
Indy是免费的!AtoZed.com的Indy是免费下载的,填入垃圾资料就可以了进入下载页我才去没多久,没这么快变收费吧?你先认真看清楚吧http://lysoft.7u7.net
感谢各位帮助!:)