找了N久,终于把JavaWeb服务编程指南找到了
太恼火了
公司使用代理上网
System.setProperty("proxySet", "true");
System.setProperty("proxyHost", "192.168.0.254");
System.setProperty("proxyPort", "8080");
URL u=new URL("http://www.sun.com");
URLConnection uc=u.openConnection();
uc.connect();
InputStream is=uc.getInputStream();
if(is!=null)
System.out.println("Proxy Success");
InetAddress.getByName("www.sun.com");
使用url连接上去都可以获得inputstream
但是InetAddress.getByName(
www.sun.com);就java.net.UnknownHostException: www.sun.com
那么这个代理到底怎么设置啊,大侠们速度..急