最近做个用httpwebrequest 模拟登陆google邮箱的程序。
目标页 https://accounts.google.com/ServiceLoginAuth目标页有两个变量是每次都会变的。
1319 行的    name="dsh" id="dsh" value="-7819690396395938861" 的value值
1325行           value="WKGCbe3uLZM"> 的 value值
而post的数据这两个都是必须的
现在我的方法是先用httpwebrequest先get一次,获取cookies,再用cookies request这个页面
现在可以保持 1325行的值不变, 但1319行尽管使用带cookies访问了,这个值还依然是会变。
在浏览器中测试,打开这个页面,每刷新一次 1319行这个值都会变。
也就是说带cookie是只能保证 1325行这个值不变, 而1319行这个值却没有办法搞。
希望大牛能提供些解决思路

解决方案 »

  1.   

    <input type="hidden"    name="dsh" id="dsh" value="7435098965457532031">
    直接正则取代码里的值
      

  2.   

    全在页面里面,呵呵
    <form id="gaia_loginform" action="https://accounts.google.com/ServiceLoginAuth" method="post">
      <input type="hidden" 
      
        
      name="dsh" id="dsh" value="3257529010027683037"  
     >
      <input type="hidden"
             name="GALX"
             value="T47RnNQfnWo">
      <input type="hidden"
        id="pstMsg"
        name="pstMsg"
        value="0">
      <input type="hidden"
        id="dnConn"
        name="dnConn"
        value="">
      <input type="hidden"
        id="checkConnection"
        name="checkConnection"
        value="">
      <input type="hidden"
        id="checkedDomains"
        name="checkedDomains"
        value="youtube">
    <input type="hidden" name="timeStmp" id="timeStmp"
           value=''/>
    <input type="hidden" name="secTok" id="secTok"
           value=''/>
    <div class="email-div">
      <label for="Email"><strong class="email-label">Email</strong></label>
      <input type="text" spellcheck="false"  
      
        
      name="Email" id="Email" value=""  
    >