vyzbzz
vyzbzz
关注数: 145
粉丝数: 108
发帖数: 630
关注贴吧数: 206
日服 3.5级工会收人 入会的都能成为欧皇! 秒批。某会长24小时不合眼审批
【新人求助】虚幻4在创建项目的时候报错了,请问我该如何解决?
各位大神,最近想买款1060,看中了以下几款,能帮忙提点建议吗?
听说明天要更新新角色,不来预测一下延迟到几点吗? 顺便那些准备吃XX的在哪,或者不维护直接开
小白想实现用httpclient发贴,现在好像只能登陆,求大神知道。 import java.util.ArrayList; import java.util.List; import org.apache.http.Header; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.client.CookieStore; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.params.CookiePolicy; import org.apache.http.cookie.Cookie; import org.apache.http.client.params.ClientPNames; import org.apache.http.impl.client.BasicCookieStore; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.message.BasicNameValuePair; import org.apache.http.protocol.HTTP; import org.apache.http.util.EntityUtils; public class Demodenglu2 { public static void login(String username,String password,String message) throws Exception { DefaultHttpClient httpclient = new DefaultHttpClient(); //实例化一个HttpClient HttpResponse response = null; HttpEntity entity = null; httpclient.getParams().setParameter(ClientPNames.COOKIE_POLICY, CookiePolicy.BROWSER_COMPATIBILITY); //设置cookie的兼容性 HttpPost httppost = new HttpPost("http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fv.m.zjxuexi.com%2Fa%2Fforum.php%3Fmod%3Dviewthread%26tid%3D21%26extra%3Dpage%253D1&urlrefer=f61fd1ed6dde40b37cf6d40a4b9f6c07"); //引号中的参数是:servlet的地址 List <NameValuePair> nvps = new ArrayList <NameValuePair>(); nvps.add(new BasicNameValuePair("username", username)); nvps.add(new BasicNameValuePair("mod", "viewthread")); // BasicNameValuePair("name", "value"), name是post方法里的属性, value是传入的参数值 nvps.add(new BasicNameValuePair("password", password)); httppost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8)); //将参数传入post方法中 response = httpclient.execute(httppost); //执行 entity = response.getEntity(); //返回服务器响应 String Newcookie = response.getFirstHeader("Set-Cookie").getValue(); System.out.println("cookie="+Newcookie.substring(0,Newcookie.indexOf(";"))); try{ System.out.println("----------------------------------------"); System.out.println(response.getStatusLine()); //服务器返回状态 Header[] headers = response.getAllHeaders(); //返回的HTTP头信息 for (int i=0; i<headers.length; i++) { System.out.println(headers[i]); } System.out.println("----------------------------------------"); String responseString = null; if (response.getEntity() != null) { responseString = EntityUtils.toString(response.getEntity()); /// /返回服务器响应的HTML代码 System.out.println("登陆成功"); //打印出服务器响应的HTML代码 } else { System.out.println("登录失败"); } } finally { if (entity != null) entity.consumeContent(); // release connection gracefully //发贴 } System.out.println("Login form get: " + response.getStatusLine()); if (entity != null) { entity.consumeContent(); } HttpPost httppost2 = new HttpPost("http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fv.m.zjxuexi.com%2Fa%2Fforum.php%3Fmod%3Dpost%26action%3Dreply%26fid%3D41%26tid%3D21%26extra%3Dpage%253D1%26replysubmit%3Dyes%26infloat%3Dyes%26handlekey%3Dfastpost%26inajax%3D1&urlrefer=90300e66467b021f05bc708ec2e93f7a"); List <NameValuePair> send = new ArrayList <NameValuePair>(); send.add(new BasicNameValuePair("message", message)); // send.add(new BasicNameValuePair("", "")); send.add(new BasicNameValuePair("handlekey", "fastpost")); send.add(new BasicNameValuePair("Referer", "http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fv.m.zjxuexi.com%2Fa%2Fforum.php%3Fmod%3Dviewthread%26tid%3D21%26extra%3Dpage%253D1%26page%3D1&urlrefer=9fb1d6b693606bb649540a5b3d13bb2c")); send.add(new BasicNameValuePair("username", username)); send.add(new BasicNameValuePair("password", password)); send.add(new BasicNameValuePair("usesig", "1")); send.add(new BasicNameValuePair("topicsubmit", "yes")); send.add(new BasicNameValuePair("infloat", "yes")); send.add(new BasicNameValuePair("action", "newthread")); send.add(new BasicNameValuePair("mod", "post")); send.add(new BasicNameValuePair("cookie", Newcookie)); httppost.setEntity(new UrlEncodedFormEntity(send, HTTP.UTF_8)); //将参数传入post方法中 response = httpclient.execute(httppost2); try{ System.out.println("----------------------------------------"); System.out.println(response.getStatusLine()); //服务器返回状态 Header[] headers = response.getAllHeaders(); //返回的HTTP头信息 for (int i=0; i<headers.length; i++) { System.out.println(headers[i]); } System.out.println("----------------------------------------"); String responseString = null; if (response.getEntity() != null) { responseString = EntityUtils.toString(response.getEntity()); /// /返回服务器响应的HTML代码 System.out.println("发贴成功"); //打印出服务器响应的HTML代码 } else { System.out.println("发贴失败"); } } finally { if (entity != null) entity.consumeContent(); // release connection gracefully //发贴 } } public static void main(String[] args) throws Exception { login("Forrenew", "wzking007","坏人"); } }
迷雾峰袋子能邮寄吗? 天成又把东西发错账号了,真坑爹。整天发小号。
大家还记得一个月前的迷雾峰活动吗? TM的多久了啊,说好的迷雾峰袋子呢!!
求救,就是这个“为亲爱的你准备的特别礼包”怎么给其他角色? 邮箱根本没法添加这个啊?怎么邮寄呢?有人成功了吗?
1
下一页