当前位置: 移动技术网 > IT编程>开发语言>.net > 无刷新随时取得用户当前活动信息

无刷新随时取得用户当前活动信息

2018年10月09日  | 移动技术网IT编程  | 我要评论

锡膏自动添加装置,看球比分,新编济公传奇

最终显示是这样的:

用户:billy 权限:管理员 时间[2004年1月21日 20:54:08] 停留[0小时0分钟] 空闲[0分钟12秒]

显示的bottom.htm文件

<script language=javascript>
<!--
function bar()
{

    var oxml(标准化越来越近了)doc = new activexobject(msxml(标准化越来越近了));             //创建msxml(标准化越来越近了)对象

    surl = "loginxml(标准化越来越近了)."      //获取登陆状态数据的地址

    oxml(标准化越来越近了)doc.url = surl;     //load数据

    var oroot=oxml(标准化越来越近了)doc.root;     //获取返回xml(标准化越来越近了)数据的根节点
    if(oroot.children != null) 

    {    

                    
              //根据返回的数据在客户端显示

              user.innerhtml=oroot.children.item(0).text;       //用户

              myclock.innerhtml=oroot.children.item(1).text;       //时间

              stay.innerhtml=oroot.children.item(2).text;    //停留

              free.innerhtml=oroot.children.item(3).text;    //空闲

              qx.innerhtml=oroot.children.item(4).text; //权限
             

    }
       if (oroot.children.item(5).text>1800)  //空闲时间超过30分钟则自动转到退出登陆页面
         window.parent.location="/user/logoff.asp?id=1";


              timeoutid = settimeout("bar()",1000)      //没1秒取得一次数据,}
//-->
</script>

用户:<font color="#ff0000"><span id=user></span></font> 权限:<font color="#ff0000"><span id=qx></span></font>  时间[<span id=myclock></span>] 停留[<span id=stay></span>] 空闲[<span id=free></span>]


提供xml(标准化越来越近了)数据的asp页面 loginxml(标准化越来越近了).asp

<%
username=session("username")
qxdm=session("qxdm")
set rs = server.createobject("adodb.recordset")
    rs.source = "select * from userlogin  where username="&username&""
    rs.open rs.source,conn,1,1
    logindate=rs("logindate")
    active=rs("active")
    rs.close
    stay=datediff("s",logindate,now())
    off=datediff("s",active,now())
    stay=stay/60

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网