Properties 简单操作

        Properties prop = new Properties();
        InputStream in = new FileInputStream(file);
        prop.load(in);
        //prop.loadFromXML(in);
        in.close();
        String name = prop.getProperty("key");
        
        Properties prop = new Properties();
        OutputStream out = new FileOutputStream(file);
        prop.setProperty(key, value);
        prop.store(out, "myname: email");
        out.close();

你可能感兴趣的:(Properties 简单操作)