依赖jar包
ini4j-0.5.4.jar
测试例子
- package cn.yjx.ini4j;
- import java.io.File;
- import java.io.IOException;
- import org.ini4j.Wini;
- public class Ini4jTest {
- public static void main(String[] args) throws IOException {
- test1();
- }
- public static void test1() throws IOException {
- String fileName = "D:\\dev\\Java\\MyEclipse_workspace\\Test\\src\\cn\\yjx\\ini\\test1.ini";
- Wini ini = new Wini(new File(fileName));
- int age = ini.get("happy", "age", int.class);
- double height = ini.get("happy", "height", double.class);
- String dir = ini.get("happy", "homeDir");
- System.out.println(age);
- System.out.println(height);
- System.out.println(dir);
- }
- }
- [happy]
- age = 99
- height = 77.66
- homeDir = /home/happy
261

被折叠的 条评论
为什么被折叠?



