首页>代码>java邮件发送service>/SystemProperties.java
package com.edu.dk.portal.app.zp.util;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Properties;

/**
 * 获取系统属性文件内容
 * 
 * @since
 * @version 2013-5-6
 * @author louweifeng
 */
public class SystemProperties {
	private static Properties properties = new Properties();

	static {
		try {
			properties.load(SystemProperties.class.getClassLoader().getResourceAsStream("mail.properties"));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	/**
	 * 根据key获取属性值
	 * 
	 * @param key
	 * @return
	 */
	public static String getProperty(String key) {
		Object value = properties.get(key);
		if (value == null) {
			return key;
		} else {
			String str = value.toString();
			try {
				str = new String(str.getBytes("ISO-8859-1"), "UTF-8");
			} catch (UnsupportedEncodingException e1) {
				e1.printStackTrace();
			}
			return str;
		}
	}
}
最近下载更多
1358849392  LV21 2022年12月27日
yliu123  LV9 2021年9月17日
1211413075  LV14 2019年6月1日
请叫我小C  LV19 2016年11月1日
fhhdrf  LV4 2016年4月12日
旧戏子  LV11 2015年11月19日
hsjkks  LV3 2015年4月27日
1743524389  LV10 2015年3月2日
如风的爱  LV28 2014年7月20日
danniel  LV4 2013年9月18日
最近浏览更多
lzx602  LV3 4月15日
1358849392  LV21 2022年12月27日
kahvia  LV1 2022年5月8日
adcxiaoxueren 2022年4月20日
暂无贡献等级
WeiZZZ  LV1 2022年3月28日
yliu123  LV9 2021年9月17日
TerryGaoBo  LV9 2021年8月16日
luesjim  LV11 2021年6月18日
linhe27  LV7 2021年3月20日
pxqtsht  LV15 2021年1月28日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友