outbound.writeBytes("/r/n/r/n");应该输出两个换行
建议用下列方式
URLConnection u=(new URL("http://www.sohu.com")).openConnection();//可以是任何URL
OutputStream os=u.getOutputStream();
InputStream is=u.getInputStream();如果是http可用
HttpURLConnection http=(HttpURLConnection)(new URL "http://www.sohu.com")).openConnection();
if(http.getResponseCode()==HttpURLConnection.HTTP_OK)){
//判断是否连接成功
}
建议用下列方式
URLConnection u=(new URL("http://www.sohu.com")).openConnection();//可以是任何URL
OutputStream os=u.getOutputStream();
InputStream is=u.getInputStream();如果是http可用
HttpURLConnection http=(HttpURLConnection)(new URL "http://www.sohu.com")).openConnection();
if(http.getResponseCode()==HttpURLConnection.HTTP_OK)){
//判断是否连接成功
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货