数字计数器问题,急,帮帮忙!!

gougou606 gougou606 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
不知道哪里有错?帮我运行一下,然后该该!!

<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>
...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
gougou606
Web 开发 81,108 成员 341,721 内容