ini4j

inno setup 5 ini4j strips backslash

試著忘記壹切 提交于 2020-01-26 02:19:46
问题 I use Inno Setup 5 to create an ini file with {app} as the destination: [INI] Filename: "{userdocs}\JavaCppDemo.ini"; Section: "InstallSettings"; Flags: uninsdeletesection Filename: "{userdocs}\JavaCppDemo.ini"; Section: "InstallSettings"; Key: "InstallPath"; String: "{app}" Then I use ini4j to get the value of InstallPath: String DefaultFolder = new FileChooser().getFileSystemView().getDefaultDirectory().toString(); // tricky way of getting at user/documents folder String strFileName =

Java ini4j - reading multiple options from .ini file

自闭症网瘾萝莉.ら 提交于 2019-12-23 02:52:46
问题 I'm trying to read multiple values using ini4j , the docs say it should be possible with the Options class. Here is my sample .ini file (./dwarfs.ini) [dopey] age = 23 fortuneNumber = 11 fortuneNumber = 33 fortuneNumber = 55 here is the code to read it: Ini ini = new Ini(); Config conf = new Config(); conf.setMultiOption(true); ini.setConfig(conf); ini.load(new FileReader("./dwarfs.ini")); but fortuneNumber property is just 55 after reading and I'd want it to be an array or a list, anything.

How to import new APIs into Java?

心已入冬 提交于 2019-12-11 10:02:20
问题 I'm a beginner programmer and am looking to utilize some features from within an API I came across on the internet, http://ini4j.sourceforge.net/ is the link to the API, it allows Java to interface with .ini files. I've downloaded the archive containing all the files necessary to import, but I'm not sure how to import them into Eclipse so that I can use them with my Java project, any help would be greatly appreciated. 回答1: The easiest way is to create a new folder under your project e.g. lib

Reading path from ini file, backslash escape character disappearing?

a 夏天 提交于 2019-12-07 06:44:57
问题 I'm reading in an absolute pathname from an ini file and storing the pathname as a String value in my program. However, when I do this, the value that gets stored somehow seems to be losing the backslash so that the path just comes out one big jumbled mess? For example, the ini file would have key, value of: key=C:\folder\folder2\filename.extension and the value that gets stored is coming out as C:folderfolder2filename.extension . Would anyone know how to escape the keys before it gets read

Reading path from ini file, backslash escape character disappearing?

断了今生、忘了曾经 提交于 2019-12-05 09:50:05
I'm reading in an absolute pathname from an ini file and storing the pathname as a String value in my program. However, when I do this, the value that gets stored somehow seems to be losing the backslash so that the path just comes out one big jumbled mess? For example, the ini file would have key, value of: key=C:\folder\folder2\filename.extension and the value that gets stored is coming out as C:folderfolder2filename.extension . Would anyone know how to escape the keys before it gets read in? Let's also assume that changing the values of the ini file is not an alternative because it's not a