[問題] 關於http file sever登入問題
前輩們好
請教http file sever(HFS)登入程式
自己在local端建一個HTTP file server
我要做的事,是把帳號、密碼給輸入手機介面裡面,
按下OK後,送出帳號密碼給server端。
想去下載裡面資料,想請教試了很久怎麼都登不進去
server端也看不到有人登入的資訊,所以想說應該是沒登入成功
以下是我的部分程式碼想請問哪邊有問題 或者有可以參考的相關資料 謝謝大家
String uriAPI = "http://192.168.1.4/cpr";
HttpPost httpRequest =new HttpPost(uriAPI);
ArrayList<NameValuePair> postParameters = new ArrayList<NameValuePair>();
postParameters.add(new BasicNameValuePair("使用者名稱",un.getText().toString()));
postParameters.add(new BasicNameValuePair("密碼", pw.getText().toString()));
try{
HttpRequest.setEntity(newUrlEncodedFormEntity(postParameters,HTTP.UTF_8));
HttpResponse httpResponse=new DefaultHttpClient().execute(httpRequest);
if(httpResponse.getStatusLine().getStatusCode()==200){
String strResult=EntityUtils.toString(httpResponse.getEntity());
un.setText(strResult);
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.67.141.6
※ 編輯: CPR520 來自: 203.67.141.6 (01/28 23:21)
推
01/29 02:02, , 1F
01/29 02:02, 1F
推
01/29 18:44, , 2F
01/29 18:44, 2F
→
01/29 19:29, , 3F
01/29 19:29, 3F
→
01/29 19:30, , 4F
01/29 19:30, 4F
推
01/30 17:21, , 5F
01/30 17:21, 5F
→
01/30 17:22, , 6F
01/30 17:22, 6F
→
02/01 21:15, , 7F
02/01 21:15, 7F