j计数器代码_JSP技巧_黑客防线网安服务器维护基地--Powered by WWW.RONGSEN.COM.CN

j计数器代码

作者:黑客防线网安JSP教程基地 来源:黑客防线网安JSP教程基地 浏览次数:0

黑客防线网安网讯:<!--   JSP-Hitcounter counts sessions.  Copyright (C) 2000 Jesper Schmitz Mouridsen.   Visit www.webappcabaret/jsm2/webapps.jsp?find=jsphcs for more info.     This pr...
<!--
   JSP-Hitcounter counts sessions.
   Copyright (C) 2000 Jesper Schmitz Mouridsen.
   Visit www.webappcabaret/jsm2/webapps.jsp?find=jsphcs for more info.
  
   This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
  
   This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License at http://www.opensource.org/licenses/gpl-license.html for more details
   -->
  
  
   <%
  
   BufferedReader inf = new BufferedReader(new FileReader("/path/to/counter.txt"));
   int tmp = Integer.parseInt(inf.readLine());
   int i=0;
  
   try {
  
   i = Integer.parseInt(request.getSession().getValue("tal").toString());
   } catch (NullPointerException t) {i=0; }
  
   if (i==0) {
   tmp++;
  
   PrintWriter outf = new PrintWriter(new BufferedWriter(new FileWriter("/path/to/counter.txt")));
   outf.println(tmp);
   outf.close();
   inf.close();
   request.getSession().putValue("tal", "1");
   }
  
   BufferedReader inf2 = new BufferedReader(new FileReader("/path/to/counter.txt"));
   %>
   <%
   String zeroes="";
   String hits = inf2.readLine();
   inf2.close();
   for (int t=0; t < 8-hits.length(); t++) {
   zeroes=zeroes+"0"; }
   out.println(zeroes + hits);
   %>
  
  
    黑客防线网安服务器维护方案本篇连接:http://www.rongsen.com.cn/show-16566-1.html
网站维护教程更新时间:2012-04-07 00:43:01  【打印此页】  【关闭
我要申请本站N点 | 黑客防线官网 |  
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479

footer  footer  footer  footer