アットウィキロゴ

写真67

package pic;
 
import java.io.*;
import java.net.URL;
import java.net.URLConnection;
public class pro {
 
 
 
    public static void main(String[] args) {
        pro y=new pro();
    }
 
    pro(){
 
 
         try {
 
URL url = new URL("http://www.e-stat.go.jp/SG1/estat/Xlsdl.do?sinfid=000006650338");
URLConnection conn = url.openConnection();
InputStream in = conn.getInputStream();
 
File file = new File("ren.xls"); 
FileOutputStream out = new FileOutputStream(file, false);
int b;
while((b = in.read()) != -1){
    out.write(b);
}
 
out.close();
in.close();
 
        } catch (Exception e) {e.printStackTrace();}  
 
 
 
    }
 
 
 
}
 
最終更新:2016年06月05日 10:36