• 企业400电话
  • 微网小程序
  • AI电话机器人
  • 电商代运营
  • 全 部 栏 目

    企业400电话 网络优化推广 AI电话机器人 呼叫中心 网站建设 商标✡知产 微网小程序 电商运营 彩铃•短信 增值拓展业务
    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);
    %>

    您可能感兴趣的文章:
    • 使用JavaScript制作一个简单的计数器的方法
    • jsp网页计数器实现示例
    • 一个简单的网站访问JS计数器 刷新1次加1次访问
    • javascript下计数器每秒自动加1
    • 用JAVASCRIPT帮我写个计数器
    • js计数器代码
    • jsp计数器制作手册
    • jsp计数器制作
    • 一个可以防止刷新的JSP计数器
    • JavaScript实现计数器基础方法
    上一篇:jsp源码实例2(获取表单参数)
    下一篇:IBM WebSphere源代码暴露漏洞
  • 相关文章
  • 

    © 2016-2020 巨人网络通讯 版权所有

    《增值电信业务经营许可证》 苏ICP备15040257号-8

    jsp计数器代码 jsp,计数器,代码,jsp,计数器,