<%@ page import="java.io.*" %>
<%
String str = "print me";
//always give the path from root. This way it almost always works.
String nameOfTextFile = "c:\\temp\\imp.txt";
try {
PrintWriter pw = new PrintWriter(new FileOutputStream(nameOfTextFile));
pw.println(str);
//clean up
pw.close();
} catch(IOException e) {
out.println(e.getMessage());
}
%>
<%
String str = "print me";
//always give the path from root. This way it almost always works.
String nameOfTextFile = "c:\\temp\\imp.txt";
try {
PrintWriter pw = new PrintWriter(new FileOutputStream(nameOfTextFile));
pw.println(str);
//clean up
pw.close();
} catch(IOException e) {
out.println(e.getMessage());
}
%>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货