public void ConnectionUrl(){
URL url;
try {
url = new URL("http://114.213.118.128:8080/thrid/SQLServerTest");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
InputStream is = conn.getInputStream();
tv1.setText("successful!!");
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
tv1.setText("fail!!");
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
tv1.setText("fail!!");
e.printStackTrace();
}
}
如上的代码,为什么android端一直显示的是fail呀,我加了网络权限的
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
网页也是存在的,I地址是我用cmd里面的ioconfig指令查出来的
大家有知道是为什么吗