zl程序教程

您现在的位置是:首页 >  其他

当前栏目

读取配置文件参数详解编程语言

配置文件编程语言 详解 参数 读取
2023-06-13 09:20:46 时间

配置文件代码:

读取配置文件参数详解编程语言

 

java代码:

try{ 

 Properties prop = new Properties(); 

 //读取属性文件horizon.properties 

 String params = request.getSession().getServletContext().getRealPath("/")+"WEB-INF//workflow-conf//properties//horizon.properties"; 

 InputStream in = new BufferedInputStream (new FileInputStream(params)); 

 prop.load(in); ///加载属性列表 

 String basicVacationDay = prop.getProperty("basicVacationDay"); 

 String tallestVacationDay = prop.getProperty("tallestVacationDay"); 

 String base = prop.getProperty("base"); 

 in.close(); 

}catch(Exception e){ 

 e.printStackTrace(); 

}

 

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/16051.html

cjava