方法一:
PropertyResourceBundle res = (PropertyResourceBundle)
PropertyResourceBundle.getBundle("application-dev"); // properties 文件名
String smtpServer = res.getString("btms.util.email.smtpServer"); //所要获取的值的 key名
String port = res.getString("btms.util.email.port");
String username = res.getString("btms.util.email.username");
String subject = res.getString("btms.util.email.subject");
String password = res.getString("btms.util.email.password");
方法二:根据 org.apache.velocity jar包提供的 PropertiesUtil 类获取
PropertiesUtil propertiesUtil = new PropertiesUtil();
Properties aString = propertiesUtil.load(Path); // properties 文件名 ,本方法文件名必须带后缀名
String aa= aString.getProperty(key); //所要获取的值的 key名