Android 网络编程之HttpURLConnection(conn.getResponseCode() != 200,从url读取写入数据)
利用HttpURLConnection对象,我们可以从网络中获取网页数据.URLurl=newURL("http://www.sohu.com");
HttpURLConnectionconn=(HttpURLConnection)url.openConnection();
conn.setConnectTimeout(6*1000);//设置连接超时
if(conn.getResponseCod