0
我想更新java中属性文件中的属性。但它正在为包含':'的字符串工作。例如,“C:\卡姆利什”写入“C \:\卡姆利什”码如下属性文件更新无法正常工作“:”
FileInputStream in = new FileInputStream("D:\\test\\prop.properties");
Properties props = new Properties();
props.load(in);
in.close();
FileOutputStream out = new FileOutputStream("D:\\test\\prop.properties");
props.setProperty("filename", "C" +":" + "\\america");
props.store(out, null);
out.close();