摘要:
分割文件1 //主函数2 File file=new File("");//文件的名称3 File dir=new File("part");4 if(!dir.exists()){5 dir.mkdirs();6 }7 splitFile(file,dir); View Code 分割方法public static void splitFile(File file,File dir) throws IOException{ ... 阅读全文
摘要:
1 FileReader fr=new FileReader("buf.txt"); 2 BufferedReader bur=new BufferedReader(fr); 3 4 FileWriter fw=new FileWriter("coptest.txt"); 5 BufferedWriter buf=new BufferedWriter(fw); 6 String str=null; 7 while((str=bur.readLine())!=null){ ... 阅读全文
摘要:
1 public class Test { 2 3 /** 4 * @param args 5 */ 6 public static void main(String[] args) { 7 // TODO Auto-generated method stub 8 File dir = new File("E:\\Test\\JAVA"); 9 FilenameFilter filter = new FilenameFilter() {10 11 @Override12 ... 阅读全文
摘要:
定义功能,获取一个应用程序运行的次数,如果超过5次,给出使用次数已到请注册的提升,并不要在运行程序 1 public static void main(String[] args) throws IOException { 2 // TODO Auto-generated method stub 3 getAppcount(); 4 } 5 public static void getAppcount() throws IOException{ 6 //将配置文件封装成File对象 7 File confile=n... 阅读全文