java使用Properties类生成配置文件
来源:互联网 发布:玩转linux系统 编辑:程序博客网 时间:2024/06/03 23:54
1、生成 .xml 格式的配置文件:
1.1 生成配置文件
Properties properties = new Properties();//生成实例
properties.setProperty("qq", "com.tarena.factory.QQ");//设置键值 key----value
properties.storeToXML(new FileOutputStream("tarena.xml"), "k---v");//像新文件存储
1.2 加载配置文件
Properties properties2 = new Properties();
properties2.loadFromXML(new FileInputStream("tarena.xml"));
2、生成 .properties 格式的配置文件:
2.1 生成配置文件
Properties properties = new Properties();//生成实例
properties.setProperty("qq", "com.tarena.factory.QQ");//设置键值 key----value
properties.store(new FileOutputStream("tarena.properties"), "key===value");2.2 加载配置文件
Properties properties2 = new Properties();
roperties2.load(new FileInputStream("tarena.properties"));
- java使用Properties类生成配置文件
- Java生成配置文件Properties
- JAVA 使用properties配置文件
- Java使用Properties类读取配置文件
- 使用java.util.Properties类读写配置文件
- java使用Properties类读取配置文件信息
- Java使用properties读取配置文件
- java中配置文件 .properties使用
- 【深入JAVA】Java中使用配置文件——properties类
- Java配置文件程序->Properties类
- Java之Properties(配置文件类)
- Java中封装配置文件(1)-使用Properties
- Java中封装配置文件(1)-使用Properties
- Java中封装配置文件(1)-使用Properties
- java中的配置文件(Properties)的使用
- Java中封装配置文件(1)-使用Properties
- Java中封装配置文件使用Properties
- 使用java读取配置文件(ini、properties)
- linux echo 打印转义字符
- Jquery4_控制Dom元素_checkbox全选及反选
- 在VS2008使用MFC+Opencv
- jQuery Validation范例与讲解
- blkid命令 获取文件系统类型、UUID
- java使用Properties类生成配置文件
- 项目经理需要修炼的9件事
- Java字符串处理与正则匹配的使用
- FTP文件传输协议两种模式-主动模式和被动模式
- Jquery5_控制Dom元素_动态创建table
- Boost库之program_options的使用
- Tree树状结构显示(dtree、xtree、ExtTree、E3tree、ztree)
- 【diannaoxitong】系统做好提前预防让病毒无从下手
- 过滤器与拦截器的区别