2 asia273360657 asia273360657 于 2013.09.07 21:40 提问

Android如何给asp网页传递参数?

我想做一个学校图书馆的手机客户端,图书馆网页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();
            }

但是得不到登陆后的页面源代码,为何?

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!