<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.io.*"%>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<META NAME="GENERATOR" CONTENT="Oracle JDeveloper">
<TITLE>
计数器演示程序
</TITLE>
</HEAD>
<BODY>
<!--创建并调用bean(counter)-->
<jsp:useBean id="counter" class="counter" scope="request">
</jsp:useBean>
<%
//调用counter对象的ReadFile方法来读取文件lyfcount.txt中的计数
String path=request.getRealPath("lyfcount.txt");String cont=counter.ReadFile(path);
//out.println(path);
out.println(cont.length());
String a = cont.substring(0,1);
String b = cont.substring(1,2);
String c = cont.substring(2,3);
String d = cont.substring(3,4);
String e = cont.substring(4,5);
String f = cont.substring(5,6);out.println(a+b+c+d+e+f);
//调用counter对象的ReadFile方法来将计数器加一后写入到文件lyfcount.txt中
counter.WriteFile(path,cont);%>您是第<font color="red"><IMG SRC="jsq/<%=a%>.jpg">
<IMG SRC="jsq/<%=b%>.jpg">
<IMG SRC="jsq/<%=c%>.jpg">
<IMG SRC="jsq/<%=d%>.jpg">
<IMG SRC="jsq/<%=e%>.jpg">
<IMG SRC="jsq/<%=f%>.jpg">
</font>位访问者
</BODY>