摘要: System.getProperty可以获取系统的一些环境变量,例:import java.util.Properties;public class PropertiesDemo { public static void main(String[] args) { Properties properties = new Properties(); properties = System.getProperties(); properties.list(System.out); }}/*输入结果: -- listing ... 阅读全文
posted @ 2012-07-17 15:37 jxgxy1 阅读(199) 评论(0) 推荐(0) 编辑
摘要: /* * Properties集合 * 特点:1、该集合中的键和值都是字符串类型 * 2、集合中的数据可以保存到流中,也可以从流中获取 * 用处: * 通常该集合用于操作以键值对形式存在的配置文件 */import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;import java.util.Properties;import java.util.Set;public... 阅读全文
posted @ 2012-07-17 15:27 jxgxy1 阅读(207) 评论(0) 推荐(0) 编辑
摘要: //使用递归删除文件夹import java.io.File;public class readLine { public static void main(String[] args) { File dir = new File("D:\\llk"); DelAll(dir); } private static void DelAll(File dir) { //获取指定目录下当前的所有文件或文件夹对像 File[] files = dir.listFiles(); for (File f... 阅读全文
posted @ 2012-07-17 15:01 jxgxy1 阅读(169) 评论(0) 推荐(0) 编辑
摘要: import java.io.File;public class readLine { public static void main(String[] args) { File dir = new File("D:\\files"); ListAll(dir); } private static void ListAll(File dir) { //获取指定目录下当前的所有文件或文件夹对像 File[] files = dir.listFiles(); for (File file : f... 阅读全文
posted @ 2012-07-17 14:50 jxgxy1 阅读(257) 评论(0) 推荐(0) 编辑