一天写一个文件,文件,/** * 原始
分享于 点击 9182 次 点评:130
一天写一个文件,文件,/** * 原始
/** * 原始调用的数据写日志 * @param strFileName 文件名 * @param strContent 文件内容 */public static void writerLog(String strFileName, String strContent) { Date date = new Date(); SimpleDateFormat format = new SimpleDateFormat( MyPGBasic.DATE_FORMAT_REGEX);//"yyyy-MM-dd" String strFileNameDate = format.format(date); format = new SimpleDateFormat(IBasic.DATE_FORMAT_REGEX); String strFileLog = format.format(date); FileWriter writer = null; try { writer = new FileWriter(GetConfigFile.strLogFilePath + strFileName + strFileNameDate + ".txt", true); writer.write(strFileLog + " "); writer.write(strContent); writer.write("\\r\\n"); writer.close(); } catch (IOException e) { e.printStackTrace(); } finally { try { writer.close(); } catch (IOException e) { e.printStackTrace(); } } }//该片段来自于http://byrx.net
用户点评