public class Index {
public static void main(String[] args) {
try {
Wini ini = new Wini(new File("C:\Users\sdkca\Desktop\myinifile.ini"));
ini.put("block_name", "property_name", "value");
ini.put("block_name", "property_name_2", 45.6);
ini.store();
// To catch basically any error related to writing to the file
// (The system cannot find the file specified)
} catch(Exception e) {
System.err.println(e.getMessage());
}
}
}
1条答案
按热度按时间wvyml7n51#
您可以尝试使用
ini4j
库。下面是一个包含读写示例的article。在Java中,它看起来是这样的: