properties文件读取配置信息

时间:2015-05-14 18:26:45   收藏:0   阅读:94
public static void main(String[] args){
        String printerName="";
        String path = "C:\\BarCodeConfig\\Printer.properties";
        Properties prop = new Properties();
        FileInputStream fis;
        try {
            fis = new FileInputStream(path);
            prop.load(fis);
            fis.close();
            printerName= prop.getProperty("printerName");
        } catch (FileNotFoundException e) {
            System.out.println(e);
        } catch (IOException ex) {
            System.out.println(ex);
        }
        System.out.println("NAME:"+printerName);
           
    }

 

原文:http://www.cnblogs.com/XueRong-7/p/4503855.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!