readProperties(String file) throws IOException
{
InputStream is=new FileInputStream(new File(file));
Properties properties= new Properties();
properties.load(is);
for (Enumeration e = properties.keys(); e.hasMoreElements();) {
String key = ((String)e.nextElement()).trim();
String value = properties.getProperty(key).trim();
System.out.println(key+":"+value);
}
OutputStream fos = new FileOutputStream(file);
properties.setProperty("name", "1");
properties.store(fos, "Update 'name' value");
}
阅读(374) | 评论(0) | 转发(0) |