惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Exploit Database - CXSecurity.com
A
Arctic Wolf
K
Kaspersky official blog
T
Threat Research - Cisco Blogs
PCI Perspectives
PCI Perspectives
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy & Cybersecurity Law Blog
O
OpenAI News
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
Cisco Blogs
AWS News Blog
AWS News Blog
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
美团技术团队
T
Threatpost
S
Schneier on Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
Cyber Attacks, Cyber Crime and Cyber Security
Last Week in AI
Last Week in AI
C
CERT Recently Published Vulnerability Notes
Blog — PlanetScale
Blog — PlanetScale
C
Cybersecurity and Infrastructure Security Agency CISA
F
Full Disclosure
博客园_首页
N
Netflix TechBlog - Medium
Security Latest
Security Latest
有赞技术团队
有赞技术团队
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Register - Security
The Register - Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Recent Announcements
Recent Announcements
博客园 - Franky
P
Palo Alto Networks Blog
Project Zero
Project Zero
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
H
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Cisco Talos Blog
Cisco Talos Blog
H
Heimdal Security Blog
The Hacker News
The Hacker News
博客园 - 【当耐特】
GbyAI
GbyAI

博客园 - 周末

JS判断IE6,ie7,ie8,ff ASP.NET(C#) 四舍五入、进一法、舍位(取整,舍去小数,向负无穷舍入)函数 HttpModule与HttpHandler详解 IE bug: 1像素的dotted/dashed边框 JS日期计算函数 同时兼容ie和ff的获取事件的方法 关于JS冒泡的问题 jQuery load()方法的美妙用法 兼容各主流浏览器的简单拖拽drag CSS 使用expression方法优化 判断 iframe 是否加载完成的完美方法 setCapture,captureEvents,releaseCapture 的技巧。 经典左右两列布局CSS 准确取得当前滚动条的位置 不常用的有意思的标签:optgroup log4net的日志输出格式-log4net.Layout.PatternLayout用法 log4net 将日志按不同类型写入多个文件 FireFox使用技巧 vs2008.net多语言实现方法
在线用户统计的实现方法
周末 · 2009-11-29 · via 博客园 - 周末

是写在global.asax这个文件里具体的代码是这样的:
<script runat="server">

    void Application_Start(object sender, EventArgs e)
    {
        //应用程序启动时运行的代码
        Application["count"] = 0;
    }
   
    void Application_End(object sender, EventArgs e)
    {
        //  在应用程序关闭时运行的代码
    }
        
    void Application_Error(object sender, EventArgs e)
    {
        // 在出现未处理的错误时运行的代码
    }

    void Session_Start(object sender, EventArgs e)
    {
        //对Appliaction加锁以防止并行性
        Application.Lock();
        
        //增加一个在线人数
        Application["count"] = (int)Application["count"] + 1;
        
        //解锁
        Application.UnLock();

    }

    void Session_End(object sender, EventArgs e)
    {
        Application.Lock();
        
        //减少一个在线人数
        Application["count"] = (int)Application["count"] - 1;
        
        Application.UnLock();
    }
      
</script>