获取文件内容
picurl = "http://www.baidu.com/data.txt"; URL urlfile = new URL(picurl); BufferedReader in = new BufferedReader(new InputStreamReader(urlfile.openStream(),"utf-8")); //utf-8避免中文乱码 String content=""; String inputLine =in.readLine(); while(inputLine!=null){ content +=inputLine; inputLine =in.readLine(); } //System.out.println(content); out.println(content); in.close();
☜☞梦想总是要有的,万一实现了呢☜☞