- //读操作
- Properties properties = new Properties();
- try
- {
- properties.load(new FileInputStream("filename.properties"));
- }
- catch (IOException e)
- {
- // implement catch logic
- }
- //写操作
- Properties properties = new Properties();
- try
- {
- properties.store(
- new FileOutputStream("filename.properties"), null);
- }
- catch (IOException e)
- {
- // implement catch logic
- }
- //该片段来自于http://www.codesnippet.cn/detail/150320132418.html
来源: http://www.codesnippet.cn/detail/150320132418.html