日期:2014-05-20  浏览次数:20588 次

修改属性文件的问题
那要怎么写属性文件呢  
比如我想把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 ");