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);
%>
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!