0

我正在尝试使用具有以下值的表单连接到 URL:

http://aulavirtual.uv.es/

如果每次我记录值更改(时间、token_id、哈希),我该怎么做?请帮我 !!我尝试使用 HttpUrlConnection,现在使用 HttpClient 4。

 <form name="login" method="post" action="/register/">
  <input type="hidden" name="form:mode" value="edit">
  <input type="hidden" name="form:id" value="login">
  <input type="hidden" name="__confirmed_p" value="0">
  <input type="hidden" name="__refreshing_p" value="0">
  <input type="hidden" name="return_url" value="/dotlrn/index">
  <input type="hidden" name="time" value="1352222384">
  <input type="hidden" name="token_id" value="423">
  <input type="hidden" name="hash" value="3F8865DB5E6603C296428A5A7C0D66C0256D5626">
      <tr>
            <td class="formulari">Nom d'usuari</td>
            <td class="formulari">
               <input type="text" id="username" name="username" value="" size="25" alt="Nom d'usuari"></td>
      </tr>
      <tr>
            <TD class="formulari">Contrasenya</TD>
            <TD class="formulari">
                <input type="password" id="password" name="password" size="25" ALT="Contrasenya d'accés"></TD>
      </tr>
      <TR>
            <TD COLSPAN="2"  class="formulari1">
               <div align="center">
                 <input id="login" type="submit" value="     Entreu      " alt="Entrar al Aula Virtual">
                 <A HREF="https://aulavirtual.uv.es"><IMG BORDER="0" HEIGHT="25" WIDTH="25" SRC="/resources/key.gif" ALT="Entrar en modo seguro" TITLE="Entrar en modo seguro"></A>
               </div>
            <!--
            <Table COLSPAN="2"  class="fonsgifs">
              <div align="center" class="titol3">
              <strong><A HREF="/altrescursos" class="font2nivell"><U>Altres cursos acad&egrave;mics</U></A></SPAN></strong>
            </table>
              <BR><BR><BR>
              <CENTER>
            -->
            <!--
              <A HREF="/dotlrn/clubs/openacslrnconference/xowiki/"><img align="center" src="/images/cabeceraOPEN.png" border = 0 align="center" alt="Conferencia OPEN" /></a>

              <BR><A HREF="/dotlrn/clubs/openacslrnconference/xowiki/"><img align="center" src="/images/ConferenciaSofwareLibre.png" border = 0 align="center" alt="Conferencia Software Libre" /></a>
              <BR><A HREF="/dotlrn/clubs/openacslrnconference/xowiki/">7th OpenACS / .LRN Conference </A> 
              <BR><A HREF="/dotlrn/clubs/openacslrnconference/xowiki/">Conferencia sobre Software Libre en Educación Superior</A>                   
              </CENTER>
            -->
        </TD>
        </TR>

      <TR>
            <TD  class="formulari1" COLSPAN="2" style="text-align:center">

            <BR><BR><BR>
            </TD>
      </TR>
    </FORM>
4

1 回答 1

3

出于安全目的,此表单使用隐藏参数。每次显示http://aulavirtual.uv.es/时,这些隐藏的参数都会发生变化。

您可以尝试更改代码以执行以下操作:

  1. 获取http://aulavirtual.uv.es/页面。
  2. 解析生成的 HTML 以从表单元素中提取 、 和 hidden 参数timetoken_id值。hash
  3. Do the POST as you do now, but pass in these three values instead of the fixed values you are using now.
于 2012-11-06T18:28:44.250 回答