📄 addmsg.java
字号:
/* **************************************************************** *//* System Name : 億乕僞儖仌僌儖乕僾僂僄傾僾儘僕僃僋僩 * File Name : UID堦尦娗棟僔僗僥儉栭娫僶僢僠(AddMsg.java) * Compiler : JDK 1.5.0 * Description : 儊僢僙乕僕庢摼僋儔僗 * ---------------------------------------------------------------- * Modification History * Date Name Description * ----------- -------------- ----------------------------------- * 2007/11/XX Initial Release * ---------------------------------------------------------------- *//* **************************************************************** */package common;import java.io.FileInputStream;import java.util.Properties;public class AddMsg { /****************************************************************** * 儊僢僙乕僕堦棗偐傜儊僢僙乕僕傪庢摼偡傞(嫟捠)丅 * * @param key 僉乕 * @return 弌椡儊僢僙乕僕(ASCII) * @version ******************************************************************/ public String getMsg(String key) { String ret = ""; FileInputStream fis = null; Properties properties = new Properties(); AddInfo info = new AddInfo(); TraceLogger trace = new TraceLogger(); try { fis = new FileInputStream(info.getMESSAGE_LOG()); properties.load(fis); ret = properties.getProperty(key); // Ascii暥帤傪曄姺 if (ret.length()>0) { ret = new String(ret.getBytes(), info.getENC_MS932()); } properties = null; } catch (Exception e) { trace.error("M219Q39S",new String[]{key}); } finally { try { fis.close(); } catch (Exception ex) {} } return ret; } /****************************************************************** * 儊僢僙乕僕堦棗偐傜儊僢僙乕僕傪庢摼偡傞(嫟捠)丅 * * @param key 儊僢僙乕僕僐乕僪 * @param val 儊僢僙乕僕杽崬僶儕儏乕抣 * @return 弌椡儊僢僙乕僕 * @version ******************************************************************/ public String getMsg(String key, String[] val) { String ret = ""; FileInputStream fis = null; Properties properties = new Properties(); AddInfo info = new AddInfo(); TraceLogger trace = new TraceLogger(); try { fis = new FileInputStream(info.getMESSAGE_LOG()); properties.load(fis); ret = properties.getProperty(key); // Ascii暥帤傪曄姺 if (ret.length()>0) { ret = new String(ret.getBytes(), info.getENC_MS932()); } if (val!=null && val.length>0) { for (int i=0; i<val.length; i++) { ret = ret.replace("["+i+"]", val[i]); } } properties = null; } catch (Exception e) { trace.error("M219Q39S",new String[]{key}); } finally { try { fis.close(); } catch (Exception ex) {} } return ret; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -