日期:2014-05-20  浏览次数:20603 次

账号密码自动登录
我需要用java编写一段自动填写密码账号的程序,我在网上找了一些,有的内容不理解,还望各路大神指点
  HttpPost httpost = new HttpPost(renRenLoginURL);  
       // All the parameters post to the web site

       List<NameValuePair> nvps = new ArrayList<NameValuePair>();  
       nvps.add(new BasicNameValuePair("origURL", redirectURL));  
       nvps.add(new BasicNameValuePair("domain", "renren.com"));  
       nvps.add(new BasicNameValuePair("isplogin", "true"));  
       nvps.add(new BasicNameValuePair("formName", ""));  
       nvps.add(new BasicNameValuePair("method", ""));  
       nvps.add(new BasicNameValuePair("submit", "登录"));  
       nvps.add(new BasicNameValuePair("email", userName));  
       nvps.add(new BasicNameValuePair("password", password));  
这段程序我看解释是传入参数,是什么意思,这些都是必须写的吗?还是用到哪行写哪行?我只需要进去后然后进到子网页,所以第一行那个需要,最后两行那个需要
而且运行结果提示org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Cookie rejected: "[version: 0][name: t][value: 777da1a44df8633563cfe88a6abda484][domain: renren.com][path: /xtalk/][expiry: null]". Illegal path attribute "/xtalk/". Path of origin: "/PLogin.do",怎么回事?
java

------解决方案--------------------
人人网,人人网登陆需要验证码的吧?
另外new BasicNameValuePair("password", password));  这里面的参数并不是固定的吧,得按照人家页面设定的名称来把。。。