package IOlv.QQzhaopian;
import java.io.*;
public class Test{
public static void main(String[] args) throws Exception {
File imgPath = new File("D:\\img");//复制地址
File toImgPath = new File("D:\\dd");//复制到的地址
File[] imgs = imgPath.listFiles();
for (int i = 0; i < imgs.length; i++) {
FileInputStream in = new FileInputStream(imgs[i]);
File img = new File(toImgPath, imgs[i].getName());
FileOutputStream out = new FileOutputStream(img);
int d = 0;
while ((d=in.read())!=-1){
out.write(d);
}
out.close();
in.close();
}
}
}
复制图片,
于 2022-07-18 11:44:15 首次发布