- URL url = new URL(“http:
- HttpURLConnection connection =(HttpURLConnection)url.openConnection();
- DataInputStream in = new DataInputStream(connection.getInputStream());
- DataOutputStream out=new DataOutputStream(new FileOutputStream(“D:\\suqiang\\to.txt”));
- byte[] buffer = new byte[4096];
- int count = 0;
- while ((count = in.read(buffer)) > 0) {
- out.write(buffer, 0, count);
- }
- out.close();
- in.close();
发表于 @ 2008年09月24日 17:44:00|评论(loading...)|收藏