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

http页面POST有关问题

2012-02-09 
http页面POST问题可能这个问题已有人问题过好多请了,但请大家也是回答我一下,谢谢。页面是这样的。DTSPAN

http页面POST问题
可能这个问题已有人问题过好多请了,但请大家也是回答我一下,谢谢。
页面是这样的。
<DT> <SPAN   style= "DISPLAY:   block "> <INPUT   class=input_id   id=id   onblur= "if   (this.value.length==0)   {this.className= 'input_id ';}   else   {this.className= 'input_none ';} "   onfocus= "installKeyCrypt();   this.className= 'input_none ' "   maxLength=24   name=id>   <LABEL   for=id> 用户名 </LABEL>   </SPAN> <SPAN   style= "MARGIN-TOP:   2px;   DISPLAY:   block "> <INPUT   class=input_pw   onkeypress= "if(event.keyCode   ==   13){login();} "   id=pw   onblur= "if   (this.value.length==0)   {this.className= 'input_pw ';}   else   {this.className= 'input_none ';} "   onfocus= "installKeyCrypt();   this.className= 'input_none ' "   type=password   maxLength=16   value= " "   name=pw   autocomplete= "off ">   <LABEL   for=pw> 密码 </LABEL>   </SPAN> </DT>
<DD> <A   onclick= "login();   return   false; "   href= "# "> <IMG   alt=登录   src= "/btn_login.gif "> </A>   </DD> </DL> </DIV>

代码:
                CppWebBrowser1-> Navigate(WideString(url).c_bstr());

IHTMLDocument2*   pDoc;
IHTMLElementCollection*   pAll;
IHTMLElement*   pBit;
IHTMLInputElement   *pUser,   *pPWD;
IDispatch*   pDisp;

CppWebBrowser1-> Document-> QueryInterface(IID_IHTMLDocument,(void**)   &   pDoc);
pDoc-> get_all(&pAll);
pAll-> item(TVariant( "id "),   TNoParam(),   &pDisp);
pDisp-> QueryInterface(IID_IHTMLInputElement,   (void**)   &   pUser);
pDisp-> Release();
WideString   myName(id);
pUser-> put_value(myName.c_bstr());
pAll-> item(TVariant( "pw "),   TNoParam(),   &pDisp);
pDisp-> QueryInterface(IID_IHTMLInputElement,   (void**)   &   pPWD);
pDisp-> Release();
WideString   myPWD(pw);
pPWD-> put_value(myPWD.c_bstr());
但没有把ID与PW填入,请问怎么可以完成这个POST过程呢,谢谢。

[解决办法]
因为你用的是get_body获取的网页内容,所以只能得到body段内的文字。

热点排行