URL url =new URL ("http://yuncode.net/list/java"); //创建一URL对象 URLConnectin con=url.openConnection(); //由URL对象获取URLConnection对象 DataInputStream dis=new DataInputStream (con.getInputSteam()); //由URLConnection获取输入流,并构造DataInputStream对象 PrintStream ps=new PrintSteam(con.getOutupSteam()); //由URLConnection获取输出流,并构造PrintStream对象 String line=dis.readLine(); //从服务器读入一行 ps.println("client…"); //向服务器写出字符串 "client…"