学习笔记,转自:http://ask.csdn.net/questions/2710
?
try { URL u=new URL("http://wx.yseasy.com/erweima_1.asp?val=yyy"); InputStream in = u.openStream(); FileOutputStream fs=new FileOutputStream("/xxx/yy.png"); byte[] buf=new byte[1024]; int r; while((r=in.read(buf))>0) fs.write(buf,0,r); in.close(); fs.close(); } catch (Exception e) { e.printStackTrace(); }
?