修改属性文件的有关问题
阅读
那要怎么写属性文件呢
比如我想把username=123456
改写成username=aaaa
用Properties类怎么做。
------解决方案--------------------
- Java code
Properties p=new Properties(); FileInputStream in=new FileInputStream(file); FileOutputStream out=new FileOutputStream(file); p.load(in); p.setProperty( "username ", "aaaa "); p.store(out, "hello ");阅读