[問題] 關於http file sever登入問題

看板AndroidDev作者 (時間是魔法!?)時間12年前 (2012/01/28 23:17), 編輯推噓3(304)
留言7則, 4人參與, 最新討論串1/1
前輩們好 請教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
192.168 是內網,手機能找到嗎?
01/29 02:02, 1F

01/29 18:44, , 2F
之前做過陽春的 不過server那邊是自己寫的
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
我猜 現成的server應該不會是叫"使用者名稱"和"密碼"
01/30 17:22, 6F

02/01 21:15, , 7F
在模擬器的電腦上裝wireshark看到底有沒有送封包出去
02/01 21:15, 7F
文章代碼(AID): #1F916ZWg (AndroidDev)