数字计数器问题,急,帮帮忙!!
不知道哪里有错?帮我运行一下,然后该该!!
<html>
<head>
<title>数字记数器</title>
</head>
<body color="#ffffff">
<%@ page import="java.io.*">
<% BufferedReader file;
String countFile="http://localhost:8080/FirstProject/count.txt";
file=new BufferedReader(new FileReader(countFile));
String readfile=null;
int writefile=1;
try{
readfile=file.readLine();
}
catch(IOException e){
out.print("数据错误!");
}
if(readfile==null)readfile="没有记录";
else
writefile=Integer.parseInt(readfile)+1;
try{
PrintWriter pw;
pw=new PrintWriter(new FileOutputStream(countFile));
pw.println(writefile);
pw.close();
}
catch(IOException e){
out.print(e.getMessage());
}
%>
<div align="center">
<p><font size="5">数字记数器:</font></p>
<p>
<font size="4" color="blue">你是本站的第</font>
<font size="5" color="red"><%=readfile%></font>
<font size="4" color="blue">位访问者!</font>
</p>
</div>
</body>
</html>