我已经成功地从我的安卓应用程序向.php页面发送了(用户名/密码)和接收到了(true/false)值。现在我正在尝试用.aspx页面替换php页面,但是在Asp.net页面(安卓应用程序到Asp.net页面)接收数据时遇到了问题。请帮助我解决这个问题。
我的安卓代码如下:
public void postLoginData() {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://xyz/Default.aspx");
try {
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("formData1", x));
nameValuePairs.add(new BasicNameValuePair("formData2", y));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
result = inputStreamToString(response.getEntity().getContent()).toString();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}