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

问个idHTTP的提交有关问题

2012-03-19 
问个idHTTP的提交问题网址是http://61.175.135.177/search/new_search/search_list.asp?我想在delphi中自

问个idHTTP的提交问题
网址是http://61.175.135.177/search/new_search/search_list.asp?
我想在delphi中自动完成提交功能,可无效,哪位高人帮忙瞧瞧,代码如下:
var   m:tstringlist;
        mm:tstringstream;
begin
    idhttp1.Request.ContentType   := 'application/x-www-form-urlencoded ';
    idhttp1.HandleRedirects   :=true;
    m:=tstringlist.Create   ;
    mm:=tstringstream.create( ' ');
    m.add( 'JZX_NO=TGHU4534249 ');
    idhttp1.Post( 'http://www.insightsoft.cn ',m,mm);
    showmessage(mm.datastring);//只显示箱号提交的表单,未执行查询
    mm.free;m.free


[解决办法]
参考一下
procedure TForm1.Button1Click(Sender: TObject);
var
m:tstringlist;
mm:tstringstream;
MutPartForm: TIdMultiPartFormDataStream;
begin

MutPartForm := TIdMultiPartFormDataStream.Create;
try
IdHTTP1.Get( 'http://61.175.135.177/search/new_search/search_list.asp ');
MutPartForm.AddFormField( 'JZX_NO ', 'TGHU4534249 ');
MutPartForm.AddFormField( 'button ', '此处不知道你button值多少 ');
memo1.Text := IdHTTP1.Post( 'http://61.175.135.177/search/new_search/search_list.asp ',MutPartForm);
finally
MutPartForm.Free;
end;
end;
[解决办法]

<td height= "22 ">    船名:
<input name= "SHIP_NAME " type= "text " class= "textfield2 " id= "SHIP_NAME3 " value= "1 " size= "14 ">
</td>
<td> 船舶英文名称:
<input name= "SHIP_NAME_EN " type= "text " class= "textfield2 " id= "SHIP_NAME4 " value= "1 " size= "14 "> </td>
<td>  

AddFormField( 'SHIP_NAME ', 船名);
出差中,没有Delphi给不了你例子

你看一下网页的HTML代码 <input name=就是你所要写的内容

热点排行