我想做一个学校图书馆的手机客户端,图书馆网页http://222.24.94.225/gdlisnet/ReaderLogin.aspx登陆时需选择登录方式,学号和密码.然后登陆成功跳转到http://222.24.94.225/gdlisnet/ReaderTable.aspx.我使用一下传递参数,
String url = "http://222.24.94.225/gdlisnet/ReaderLogin.aspx?";
HttpPost httpre = new HttpPost(url);
List<NameValuePair> params = new ArrayList<NameValuePair>();
BasicNameValuePair pair1 = new BasicNameValuePair("DropDownList1", "借书证号");
BasicNameValuePair pair2 = new BasicNameValuePair("TextBox1", "我的学号");
BasicNameValuePair pair3 = new BasicNameValuePair("TextBox2", "我的密码");
params.add(pair1);
params.add(pair2);
params.add(pair3);
try {
HttpEntity entity = new UrlEncodedFormEntity(params,"utf-8");
httpre.setEntity(entity);
HttpClient httpClient = new DefaultHttpClient();
HttpResponse response = httpClient.execute(httpre);
if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
String result = EntityUtils.toString(response.getEntity());
//Looper.prepare();
tv.setText(result);
//Looper.loop();
} else {
tv.setText("应答错误");
}
} catch (UnsupportedEncodingException e) {
// TODO: handle exception
e.printStackTrace();
}catch(ClientProtocolException e){
e.printStackTrace();
}catch (IOException e){
e.printStackTrace();
}
但是得不到登陆后的页面源代码,为何?