本文共 475 字,大约阅读时间需要 1 分钟。
- protected Properties load() {
- try {
- Properties prop = new Properties();
- String path = "prop/conf.properties";
-
- String os = System.getProperty("os.name");
- if (os.toLowerCase().startsWith("win")) {
- path = "/src/prop/conf.properties";
- }
- InputStream in = new FileInputStream(System.getProperty("user.dir") + File.separator + path);
- prop.load(in);
- return prop;
- } catch (Exception ex) {
- log.error("加载配置文件异常,系统over@@", ex);
- System.exit(0);
- }
- return null;
- }
转载地址:http://iykvl.baihongyu.com/