configreader.java

来自「用JAVA开发的提醒精灵」· Java 代码 · 共 39 行

JAVA
39
字号
package com.liming.remind.common;


import java.io.FileInputStream;
import java.util.Properties;


/**
 * Function : Read configuration from a file
 * 
 * @author Liming
 * @time Dec 23, 2008 7:19:38 PM
 * @version 1.0
 */
public class ConfigReader {

    private Properties p;

    public ConfigReader() {
        p = new Properties();
        try {
            // To load the input stream
            // which parameter is properties file
            p.load(new FileInputStream("res\\config.properties"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * Function : Get Remind Kind
     * 
     * @return
     */
    public String getRemindKind() {
        return p.getProperty("kind");
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?