xdjm帮小弟一下吧(有关文件的问题)
public void fillTemplate(HttpServletRequest request, HttpServletResponse response){
Template templatehandle = new Template();
BigDecimal TemplateID = BigDecimal.valueOf(Integer.valueOf(getParamValue(request,"Template")).intValue());
String MSGTitle = getParamValue(request,"Subject");
String MSGBody = getParamValue(request,"Content");
String Name = "先生";
String html = templatehandle.FillTemplateMsg(TemplateID,MSGTitle,Name,MSGBody);
String FileName = "test.html";
String FilePath = "c:\\test";
try{
File fp = new File(FilePath,FileName);
boolean flag = fp.exists();
// ----------------------------------------------------------------------------- //
if(flag == true)
System.out.println("OK");
else
System.out.println("NOTHING");
// ----------------------------------------------------------------------------- //
FileOutputStream fi = new FileOutputStream(fp);
ObjectOutputStream si = new ObjectOutputStream(fi);
si.writeChars(html); // 有问题?
}
catch(IOException e){
e.toString();
}
}
为什么,到文件中的时候会无法显示字符呢,但确实是写进去了。文件大小也变化了,但就是看不到字符:(,请各位帅哥,美女帮忙了!