资源简介

最近根据其它项目整合的一个在线用户列表和在线用户统计...在线用户列表显示有分页功能..可以区分关闭浏览器的的退出方式..

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;

namespace WebApplication1
{
    public partial class Default1 : System.Web.UI.Page
    {
        protected string strTable = ““;
        protected void Page_Load(object sender EventArgs e)
        {
            //////LJL20131125star
            if (!IsPostBack)
            {
                Bind(this.AspNetPager1.CurrentPageIndex);
            }
        }
        //获取当前单元格
        public string ReturnTr(string str)
        {
            string tr = ““;
            foreach (string item in str.Split(‘‘))
            {
                tr += ““ + item + ““;
            }
            return tr;

        }
        //List分页
        public ArrayList ToPageList(ArrayList flightList int perPageNum int pageNum)
        {

            int pageCount = 0;
            if (flightList.Count % perPageNum == 0)
            {
                pageCount = flightList.Count / perPageNum;
            }
            else
            {
                pageCount = (flightList.Count / perPageNum) + 1;
            }
            //超过总页数置为最后一页
            if (pageNum > pageCount)
            {
                pageNum = pageCount;
            }

            //计算需要显示的结果数据
            ArrayList flightPageList = new ArrayList();
            for (int i = ((pageNum - 1) * perPageNum); i < flightList.Count && i < ((pageNum) * perPageNum) && pageNum > 0; i++)
            {
                flightPageList.Add(flightList[i]);
            }
            return flightPageList;
        }
        private void Bind(int index)
        {
            ArrayList li = Application.Get(“Global_User_List“) as ArrayList;
            if (this.AspNetPager1.CurrentPageIndex - 1 != index)
            {
                this.AspNetPager1.CurrentPageIndex = this.AspNetPager1.CurrentPageIndex - 1;
            }
            this.AspNetPager1.RecordCount = li.Count;
            ArrayList list = ToPageList(li this.AspNetPager1.PageSize this.AspNetPager1.CurrentPageIndex);
            string str = ““;
            str += “登陆账号登陆密码“;
            if (list != null)
            {
                foreach (string item in list)
                {
                    str += ““ + ReturnTr(item) + ““;
                }
                str += ““;

            }
            strTable = str;
            Response.Write(“在线总人数 :“ + li.Count + “
“);

        }
        /////LJL20131125end
        protected void AspNetPager1_PageChanged(object sender EventArgs e)
        {
            Bind(this.AspNetPager1.CurrentPageIndex - 1);
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-11-27 16:40  WebSite6\
     目录           0  2013-11-27 16:40  WebSite6\WebApplication1\
     目录           0  2013-11-27 17:10  WebSite6\WebApplication1\WebApplication1\
     目录           0  2013-11-27 16:40  WebSite6\WebApplication1\WebApplication1\App_Data\
     目录           0  2013-11-27 17:05  WebSite6\WebApplication1\WebApplication1\bin\
     文件       61440  2012-09-20 11:19  WebSite6\WebApplication1\WebApplication1\bin\aspnetpager.dll
     文件        7680  2013-11-27 17:06  WebSite6\WebApplication1\WebApplication1\bin\WebApplication1.dll
     文件       22016  2013-11-27 17:06  WebSite6\WebApplication1\WebApplication1\bin\WebApplication1.pdb
     文件        2549  2013-11-27 17:10  WebSite6\WebApplication1\WebApplication1\Default1.aspx
     文件        2995  2013-11-27 17:02  WebSite6\WebApplication1\WebApplication1\Default1.aspx.cs
     文件        1186  2013-11-27 17:00  WebSite6\WebApplication1\WebApplication1\Default1.aspx.designer.cs
     文件          99  2013-11-27 16:40  WebSite6\WebApplication1\WebApplication1\Global.asax
     文件        1808  2013-11-27 16:52  WebSite6\WebApplication1\WebApplication1\Global.asax.cs
     目录           0  2013-11-27 16:40  WebSite6\WebApplication1\WebApplication1\obj\
     目录           0  2013-11-27 16:40  WebSite6\WebApplication1\WebApplication1\obj\Debug\
     目录           0  2013-11-27 16:40  WebSite6\WebApplication1\WebApplication1\obj\Debug\TempPE\
     目录           0  2013-11-27 17:06  WebSite6\WebApplication1\WebApplication1\obj\Release\
     文件        5041  2013-11-27 17:02  WebSite6\WebApplication1\WebApplication1\obj\Release\ResolveAssemblyReference.cache
     目录           0  2013-11-27 16:40  WebSite6\WebApplication1\WebApplication1\obj\Release\TempPE\
     文件         445  2013-11-27 17:05  WebSite6\WebApplication1\WebApplication1\obj\Release\WebApplication1.csproj.FileListAbsolute.txt
     文件        7680  2013-11-27 17:06  WebSite6\WebApplication1\WebApplication1\obj\Release\WebApplication1.dll
     文件       22016  2013-11-27 17:06  WebSite6\WebApplication1\WebApplication1\obj\Release\WebApplication1.pdb
     目录           0  2013-11-27 16:40  WebSite6\WebApplication1\WebApplication1\Properties\
     文件        1317  2013-11-27 16:40  WebSite6\WebApplication1\WebApplication1\Properties\AssemblyInfo.cs
     文件         372  2013-11-27 16:48  WebSite6\WebApplication1\WebApplication1\session_test.js
     文件         453  2013-11-27 16:49  WebSite6\WebApplication1\WebApplication1\test.aspx
     文件         492  2013-11-27 16:48  WebSite6\WebApplication1\WebApplication1\test.aspx.cs
     文件        7822  2013-11-27 16:40  WebSite6\WebApplication1\WebApplication1\Web.config
     文件        4983  2013-11-27 17:05  WebSite6\WebApplication1\WebApplication1\WebApplication1.csproj
     文件        1297  2013-11-27 17:05  WebSite6\WebApplication1\WebApplication1\WebApplication1.csproj.user
     文件        1357  2013-11-27 17:10  WebSite6\WebApplication1\WebApplication1\WebForm1.aspx
............此处省略4个文件信息

评论

共有 条评论