日期:2014-05-20 浏览次数:21230 次
public static void main(String[] args) throws IOException {
BufferedWriter pw=null;
try{
pw=new BufferedWriter(new FileWriter("C:\\1.log",true));
StringBuffer hisStr = new StringBuffer();
hisStr.append("192.168.1.39|");
hisStr.append(null+"|");
hisStr.append("1001|");
hisStr.append("3|");
hisStr.append("444|");
hisStr.append(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
hisStr.append("\r\n");
pw.write(hisStr.toString());
}catch(Exception e){
System.out.println(e);
}finally{
pw.flush();
pw.close();
}
}