<html>
<body>
<%@ page import="java.io.*"%>
<%
BufferedReader file;
String countFile="c:\\count.txt";
String readStr=null;
int writeStr=1;
try
{
file=new BufferedReader(new FileReader(countFile));
readStr=file.readLine();
}catch(IOException e)
{
System.out.println("read data error");
}
if(readStr==null) readStr="no data";
else
{
writeStr=Integer.parseInt(readStr)+1;
}try{
PrintWriter pw;
pw=new PrintWriter(new FileOutputStream(countFile));
pw.println(writeStr);
pw.close();
} catch(IOException e)
{
System.out.println(e.getMessage());
}
%>
<h1> you are the </h1>
<h3> <%=readStr%></h3>
<h1> vistor to the page</h1>
</body>
</html>
<body>
<%@ page import="java.io.*"%>
<%
BufferedReader file;
String countFile="c:\\count.txt";
String readStr=null;
int writeStr=1;
try
{
file=new BufferedReader(new FileReader(countFile));
readStr=file.readLine();
}catch(IOException e)
{
System.out.println("read data error");
}
if(readStr==null) readStr="no data";
else
{
writeStr=Integer.parseInt(readStr)+1;
}try{
PrintWriter pw;
pw=new PrintWriter(new FileOutputStream(countFile));
pw.println(writeStr);
pw.close();
} catch(IOException e)
{
System.out.println(e.getMessage());
}
%>
<h1> you are the </h1>
<h3> <%=readStr%></h3>
<h1> vistor to the page</h1>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货