JAVA (复制U盘内容到本地)
发布时间
阅读量:
阅读量
信息安全课程的教师所布置的课业任务,需要将U盘中的数据在不发出任何声响的情况下传输至本地设备中。
public class USB_test {
public static void main(String[] args) {
// TODO Auto-generated method stub
IsUSB test = new IsUSB();
test.start();
}
}
//检查有无新盘符
import java.io.File;
public class IsUSB extends Thread{
File[] fileSystemRoot = File.listRoots(); //系统盘符列表
File[] currentRoot = null ; //当前盘符列表
public void run() {
/*
for(File root:fileSystemRoot) {
全部评论 (0)
还没有任何评论哟~
