读书人

将字段写下到文件中

发布时间: 2012-10-25 10:58:57 作者: rapoo

将字段写入到文件中

将字段写入文件中,保存为UTF-8格式

String path=request.getRealPath("");//获得项目路径String str="";//要写入的字符FileOutputStream fos = new FileOutputStream(path+"/resources/temp/industry.js");Writer writer = new OutputStreamWriter(fos, "UTF-8");str="document.writeln(\"<div class=current id=''></div>\");";writer.write(str);writer.close();fos.close();

???

读书人网 >编程

热点推荐