xdjm帮小弟一下吧(有关文件的问题)

spiderbat 2004-02-06 11:58:40
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();
}
}
为什么,到文件中的时候会无法显示字符呢,但确实是写进去了。文件大小也变化了,但就是看不到字符:(,请各位帅哥,美女帮忙了!
...全文
102 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧