public String doSingleLink(String url, String loginsuccess, String jsTxt,String email,String pwd) throws IOException { // 读取登录页面内容 URL serviceIpUrl = new URL(url); URLConnection connection = serviceIpUrl.openConnection(); connection.setRequestProperty("method", "post"); connection.connect(); InputStreamReader isr = null; BufferedReader br = null; String loginTxt = ""; InputStream is = connection.getInputStream(); is = connection.getInputStream(); isr = new InputStreamReader(is,"utf-8"); br = new BufferedReader(isr); String str = ""; try { while ((str = br.readLine()) != null) { loginTxt += str + "\r\n"; } } catch (IOException e) { e.printStackTrace(); } br.close(); is.close(); return loginTxt; }
简单记下。
努力生活,珍惜一切,知足最快乐!young joy..