读书人

求ASP.NET(VB)现阶段在线人数源代码

发布时间: 2011-12-22 23:36:25 作者: rapoo

求ASP.NET(VB)当前在线人数源代码
写了一个函数统计在线人数,总是出错。求一个正确的函数源代码,请高手们帮忙,让我参考你们正确的代码,急用,谢谢!

[解决办法]
不会也要坐沙发
[解决办法]
Global.asax 文件
------------

<script language= "vb " runat= "server ">
sub application_start(S As Object, E As EventArgs)
Application( "counter ")=0
end sub
sub session_start(S As Object, E As EventArgs)
Session( "On_Line ")=False
end sub
</script>



*.aspx 文件
-----------

<script language= "VB " runat= "server ">
function webcounter() as long
if not session( "on_line ") then
application.Lock()
application( "counter ")=application( "counter ")+1
application.UnLock()
session( "on_line ")= true
end if
webcounter=application( "counter ")
end function
</script>

<html>
<head>
<title> count </title>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
</head>
<body>

<h2> 您是第 <font color= "blue "〉 <%= WebCounter %> </font> 位访客! </h2>


</body>
</html>

[解决办法]
这是访问量 不是统计在线人数
你先要拿个东西 纪录登陆了的人员信息 临时表或其他什么东西

读书人网 >asp.net

热点推荐