日期:2014-05-20 浏览次数:20850 次
File file = new File("D://param.properties"); FileInputStream fis = null; FileOutputStream fos = null; try { fis = new FileInputStream(file); Properties prop = new Properties(); prop.load(fis); prop.setProperty("key", "3"); fos = new FileOutputStream(file); prop.store(fos, null); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); }finally{ try { fis.close(); fos.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }