jsp计数器代码

jinleitouzi

jinleitouzi

2016-01-29 12:04

jsp计数器代码,jsp计数器代码
  <!--
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);
%

 
展开更多 50%)
分享

猜你喜欢

jsp计数器代码

Java JAVA基础
jsp计数器代码

jsp计数器-jsp文件

Java JAVA基础
jsp计数器-jsp文件

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

jsp计数器制作

Java JAVA基础
jsp计数器制作

js计数器代码

Web开发
js计数器代码

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

jsp计数器-bean文件

Java JAVA基础
jsp计数器-bean文件

jsp计数器制作手册

Java JAVA基础
jsp计数器制作手册

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

捷足先登学用CSS:HTML结构化

捷足先登学用CSS:HTML结构化

PSV《高达破坏者2》游戏系统操作详细解析

PSV《高达破坏者2》游戏系统操作详细解析
下拉加载更多内容 ↓