📄 badpagecounter.aspx
字号:
<%@ Page Language="C#" %>
<script language="C#" runat=server>
void Page_Load(Object sender , EventArgs e)
{
if(null == Application["PageCounter"])
{
Application.Lock();
Application["PageCounter"] = 0;
Application.UnLock();
}
int aHits = 0;
int nHits = (int) Application["PageCounter"];
aHits = (int)aHits + 1;
Application.Lock();
Application["PageCounter"] = aHits;
lblCount.Text = Application[ "PageCounter" ].ToString();
//lblCount.Text["PageCounter"] = aHits;
Application.UnLock();
}
</Script>
<html>
<head><title>GoodPageCounter.aspx</title></head>
<body>
This page has been requested:
<asp:Label
ID="lblCount"
Runat="Server" />
times!
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -