<%@ page contentType="text/html;charset=gb2312" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="KEYWORDS" content="这是一个虚拟的JSP小站主页,作为小龙亭JSP实践之旅的一部分。">
<title>每日的文学阳光</title>
<link rel=stylesheet href="style.css" type="text/css">
</head>
<body>
<%@ include file="top.htm" %>
<p>&nbsp;</p>
<%@ page import="java.io.*" %><% 
String currentRecord = null;//保存文本的变量
BufferedReader file; //BufferedReader对象,用于读取文件数据
String nameOfTextFile = "count.txt";
//读取
file = new BufferedReader(new FileReader(nameOfTextFile));
String readStr =null;
int writeStr =0;   //如果数据库为空则让它显示时变成1并写入
try
{ readStr = file.readLine(); }
catch (IOException e)
{ System.out.println("读取数据错误."); }
if (readStr == null) readStr = "没有任何记录";
//加1
else { writeStr = Integer.parseInt(readStr)+1;}//写入
try { 
PrintWriter pw = new PrintWriter(new FileOutputStream(nameOfTextFile));
pw.println(writeStr);
pw.close();}catch(IOException e) {
out.println(e.getMessage());
}
%>
<p align="center">您是小龙亭第<b><font color="red"><%=writeStr%></font></b>位客人。请选择:</p>
<br><br>
<center>
<table width="70%">
<tr>
<td align="center" width="20%"><a href="login.jsp">登录</a></td>
<td align="center" width="20%"><a href="register.jsp">注册</a></td>
<td align="center" width="20%"><a href="shade.jsp">留言</a></td>
<td align="center" width="20%"><a href="appriciate.jsp">文学欣赏</a></td>
<td align="center" width="20%"><a href="forum.jsp">风景论坛</a></td>
</tr>
</table>
</center>
<p>&nbsp;</p>
<%@ include file="bottom.htm" %>
</body>
</html>麻烦看看,呵呵!