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

推荐订阅源

S
Security @ Cisco Blogs
Microsoft Security Blog
Microsoft Security Blog
GbyAI
GbyAI
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
L
LangChain Blog
爱范儿
爱范儿
N
Netflix TechBlog - Medium
The Register - Security
The Register - Security
Jina AI
Jina AI
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
I
InfoQ
罗磊的独立博客
Stack Overflow Blog
Stack Overflow Blog
Microsoft Azure Blog
Microsoft Azure Blog
Last Week in AI
Last Week in AI
Recorded Future
Recorded Future
D
DataBreaches.Net
Project Zero
Project Zero
博客园 - 【当耐特】
宝玉的分享
宝玉的分享
T
The Exploit Database - CXSecurity.com
A
Arctic Wolf
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Engineering at Meta
Engineering at Meta
D
Docker
F
Fortinet All Blogs
P
Palo Alto Networks Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Tailwind CSS Blog
S
Schneier on Security
博客园 - 司徒正美
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Scott Helme
Scott Helme
Security Latest
Security Latest
V
Visual Studio Blog
T
Tor Project blog
I
Intezer
T
Threat Research - Cisco Blogs
MyScale Blog
MyScale Blog
月光博客
月光博客
MongoDB | Blog
MongoDB | Blog
P
Privacy International News Feed
云风的 BLOG
云风的 BLOG
C
Cisco Blogs
The Cloudflare Blog
Simon Willison's Weblog
Simon Willison's Weblog
Vercel News
Vercel News
S
Securelist

博客园 - 绿毛虫

技巧/诀窍:在ASP.NET中重写URL(转) scrollLeft,scrollWidth,clientWidth,offsetWidth到底指的哪到哪的距离之完全详解 重写的支持多验证TextBox控件(转) 呵呵 帮忙顶下咯 您需要掌握的八个CSS布局技巧(转) 采用DIV+CSS布局的好(转) 如何遍历Request的信息(转自孟子E章) 如何把html(form1)中的值用Submit传给serch.aspx页面,在serch.aspx又如何获取呢?(收集) 如何生成静态页面的五种方案(转) 在ASP.Net中使用FCKeditor FCKeditor 2.0 的设置.修改.使用(转) FckEditor中文配置手册详细说明(转) c#文件上传类(转) C#文件上传类(转) 服务器端FileUpload上传控件如何禁止手动输入(原) AJAX入门之深入理解JavaScript中的函数(转) C#文件上传类(转) asp.net利用RAR实现文件压缩解压缩[转载] C#加密解密方法 (转)
asp.net网站统计(转)
绿毛虫 · 2007-11-08 · via 博客园 - 绿毛虫

今天在 我在所的网站上加了一个简单的网站统计如图所示:网站统计

鼠标放上去可以这样显示:      这就是今天做的简单的网站统计.

现在就来讲讲,是怎么实现的.我用的asp.net 2003 版本.

文章总数,文件总数就是读取数据库的操作,在这里就不说了.

对与总访问量,我是将这个参数存在count.xml文件里面,通过读取这个文件修改获得,在线访问量我通过Global里面Application设置参数来实现.

count.xml代码如下(简单):

Global里面的关键代码如下:

在显示部分代码,我写在用户控件里面,这样可重用性高,代码如下:

<class="" href='#' Title='文章总数:<%=ArticleCount%> 文件总数:<%=FileCount%> 总访问量:<%=TotalCount%> 在线访问量:<%=OnlineCount%>'>
    网站统计
</a>

.cs代码

当然,这是一个很简单的统计,如果需要统计本周或者本月访问情况,自然还可以在count.xml里面添加一些参数,继续操作.

说明一点,Application参数也可以用Session参数来代替,用法一模一样.