Properites pros=new Properties();
pros.load(new FileInputStream(new File("mail.config")));String mail_rule=properties.get("mail.rule");
..
pros.load(new FileInputStream(new File("mail.config")));String mail_rule=properties.get("mail.rule");
..
调试欢乐多
这样的方法不是读写.properties文件的吗?
.config也是这样读啊?呵呵
pros.load(new FileInputStream(new File("mail.config")));读:
String mail_rule=properties.get("mail.rule");写:
properties.setProperty("mail.rule", "XXXXXXXXXXXX")
-------------------
在java里点到一个具体的小模块,如J2SE/基础类
电击右上角要个提问.
原来只要符合
“名称=值”这样的格式的文件都可以用Properties来读写
pros.load(new FileInputStream(new File("mail.config")));
写的时候不好使呀??
pros.store(new FileOutputStream(new File("mail.config")),"header");