store方法保存到文件,修改的话你可以先读出来然后修改Prop里面的值,在store

解决方案 »

  1.   

    应该这样使用
    Properties prop = new Properties();
    prop.load(new FileInputStream(prop.ini));
    .....
    prop.store(new FileOutputStream(prop.ini),null);
      

  2.   

    用Properties类的setProperty和store方法
      

  3.   

    我的编程环境是java1.1.1不是java2
      

  4.   

    //prop.ini
    s1=bbbb//
    Properties prop = new Properties();
    prop.load(new FileInputStream(prop.ini));
    string s1 = prop.getPropertie("s1");
    s1="aaaa";
    prop.setPropertie("s1",s);
    prop.save(new FileOutputStream("c:\prop.ini"),null);
    在Java2使用store取代了save
    //new prop.ini
    s1=aaaa