您当前的位置:delphi教程 > Delphi网络通信 > 请教关于IdHTTP Post的问题

请教关于IdHTTP Post的问题

这是我的代码,是BCB的    
        AnsiString     UserName,Password,   BaseURL;  
          AnsiString   HTML;  
   
          BaseURL     =   "http://10.0.0.1/start.nsf/";  
          UserName   =   "guest";  
          Password   =   "guest";  
          TStringList*   Params   =   new   TStringList();  
          Params->Add("Username="+UserName);  
          Params->Add("Password="+Password);  
          Params->Add("comeurl="+BaseURL+"homepage?OpenFrameSet");   //   这里是登录成功后自动转入的页面,如果没有通过验证而访问此页面,将转入登录页面。   代码目标是需要取得此页面的内容  
   
          //IdHTTP1->Request->ContentType="application/x-www-form-urlencoded";  
          IdHTTP1->Post(BaseURL+"firstpage?openpage",Params);       //这里是登录页面  
          Memo1->Text   =   HTML;  
          delete   Params;  
   
  下面是登录页面的HTML源码,为何每次获得到结果都是它?   好像没有通过验证(确认登录密码没错)请高手看看问题出在哪,谢谢!  
  <HTML>  
  <!--   Lotus-Domino   (Release   5.0.9   -   November   16,   2001   on   Solaris   Sparc)   -->  
  <HEAD>  
   
  <SCRIPT   LANGUAGE="JavaScript">  
  <!--    
  function   MM_reloadPage(init)   {     //reloads   the   window   if   Nav4   resized  
      if   (init==true)   with   (navigator)   {if   ((appName=="Netscape")&&(parseInt(appVersion)==4))   {  
          document.MM_pgW=innerWidth;   document.MM_pgH=innerHeight;   onresize=MM_reloadPage;   }}  
      else   if   (innerWidth!=document.MM_pgW   ||   innerHeight!=document.MM_pgH)   location.reload();  
  }  
  MM_reloadPage(true);  
  function   MM_openBrWindow(theURL,winName,features)   {   //v2.0  
      win0=window.open(theURL,winName,features);  
      win0.focus();  
  }  
  //MM_openBrWindow('/happy.htm','happy','width=480,height=350,left=width')  
  //MM_openBrWindow('/test.htm','test','width=500,height=250,left=0   ,top=0')  
  //   -->  
  </SCRIPT>  
  </HEAD>  
  <BODY   TEXT="000000"   BGCOLOR="FFFFFF"   bgcolor="#1D4994"   text="#000000"   leftmargin="0"   topmargin="0"   marginwidth="0"   marginheight="0"   background="/images/login/login_bg.jpg"   onload=setTimeout("showlogin()",500)>  
   
  <FORM   METHOD=post   ACTION="/names.nsf?Login"   NAME="_DominoForm">  
  <INPUT   TYPE=hidden   NAME="%%ModDate"   VALUE="0000000000000000"><style   type="text/css">  
  <!--  
  table   {     background-attachment:   fixed;   background-repeat:   no-repeat;   background-position:   center   center;}  
  body   {     background-repeat:   no-repeat;   background-position:   center   center;background-color:   #1b4f9b}  
  -->  
  </style>  
  <table   width="100%"   border="0"   cellspacing="0"   cellpadding="0"   height="100%">  
      <tr>    
          <td   align="center"   valign="middle"><br><br><br><br><br><br><br>  
              <table   width="260"   border="0"   cellspacing="0"   cellpadding="0"   height="140"   background=""   style="filter:   Alpha(Opacity=0)"   id=maintable>  
                  <tr>    
                      <td   align="center"   valign="middle"><FONT   SIZE=2   COLOR="ff0000"></FONT>  
                          <table   width="180"   border="0"   cellspacing="0"   cellpadding="0"   height="131"   background="">  
                              <tr>    
                                  <td   width="180"   align="center">    
                                      <table   width="180"   border="0"   style=font-size:9pt   cellspacing="4">  
                                          <tr>    
                                              <td   width="60"   style="color:#ffffff">用户名:   </td>  
                                              <td   width="100">  
  <INPUT   NAME="Username"   VALUE=""   maxlength=256   size=10></td>  
                                          </tr>  
                                          <tr>    
                                              <td   width="60"   style="color:#ffffff">密码:</td>  
                                              <td   width="100">  
  <INPUT   NAME="Password"   VALUE=""   TYPE=password   maxlength=256   size=10></td>  
                                          </tr>  
                                          <tr   align="center">    
                                              <td   colspan="2">   <br>  
                                                  <input   type="image"   border="0"   name="imageField"   src="/images/login/confirm.gif"   width=56   height=22>  
                                              </td>  
   
   
                                          </tr>  
                                      </table>  
                                  </td>  
                              </tr>  
                          </table>  
                      </td>  
                  </tr>  
              </table>  
  <p   style=font-size:15pt>&nbsp;</p><p   style=font-size:15pt>&nbsp;</p>  
  <div   align="center"><font   color="#2a7fcd">│</font><a   href=#   onclick="MM_openBrWindow('/link2.htm','','width=412,height=256')"><font   color="#ffffff"   style=font-size:9pt>技术支持</font></a><font   color="#2a7fcd">│</font><a   href=#   onclick="MM_openBrWindow('/link3.htm','','width=412,height=256')"><font   color="#ffffff"   style=font-size:9pt>联系我们</font></a><font   color="#2a7fcd">│</FONT>  
   
  </div>  
  <p>&nbsp;</p>  
  </font>  
          </td>  
      </tr>  
  </table>  
  <script   language="JavaScript">  
  var   loginAlpha=0;  
  function   showlogin(){  
  if   (loginAlpha<80)   {  
      loginAlpha+=7;  
      maintable.style.filter="Alpha(Opacity="+loginAlpha+")";  
      alpha=setTimeout("showlogin()",50);  
    }  
  else   {  
  setTimeout("focus()",50);  
    }  
  }  
  function   focus(){  
  document.forms[0].Username.focus();    
  document.forms[0].Username.select();  
  }  
  </script>  
  <div   style=display:none>  
  <P><FONT   SIZE=2>  
  <INPUT   NAME="RedirectTo"   VALUE="/start.nsf/firstpage?openpage"   type=hidden></FONT>  
  <P>  
  <INPUT   TYPE=submit   VALUE="提交"></FORM>  
  </BODY>  
  </HTML>  
 


查看回复
关于我们 | 网站地图 | 广告刊登 | 友情链接
Copyright ©2008 - 2010  Delphi2007.net  ,All Rights Reserved  粤ICP备09038647号
业务联系:allceoad#gmail.com QQ:20008835 最佳分辨率 1024×768