RT,等待高人~

解决方案 »

  1.   


    FileOutputStream fos = new FileOutputStream(file,true);
      

  2.   

    追加是在最后。中间插入?i don't know, u can try。
      

  3.   

    格式只是表面的,内容才是关键。用Properties类操作词典就OK拉。
      

  4.   

    请问Properties整个类怎么具体的操作辞典呢?能稍微介绍一下么?马上揭帖
      

  5.   

    你要先加载dat才行!~加载后写文件
      

  6.   


    public static void setFaxLoginValue(Object porpertyName, Object porpertyValue)
      {
        if ((porpertyName == null) || (porpertyValue == null))
        {
          return;
        }
        Object value = porpertyValue;
        if (porpertyValue instanceof Integer)
        {
          value = porpertyValue.toString();
        }
        try
        {
          File file = new File(BizFaxDefine.FAX_LOGIN_CONFIG);
          Properties props = new Properties();
          props.load(new FileInputStream(file));
          props.put(porpertyName, value);
          props.store(new FileOutputStream(BizFaxDefine.FAX_LOGIN_CONFIG), 
            "the fax login config file hava been modified!");      if (porpertyName.equals("KEY_FAX_USER_NAME"))
          {
            BizFaxDefine.FAX_USER_NAME = porpertyValue.toString(); return;
          }
          if (!(porpertyName.equals("KEY_FAX_USER_STATUS")))
            return;
          BizFaxDefine.FAX_USER_STATUS = Integer.parseInt(porpertyValue.toString());
        }
        catch (Exception e)
        {
          BizCommonUtil.log(null, "修改传真登陆配置文件信息出错。", e, Level.ERROR);
        }
      }