📄 cf.asp
字号:
Sql= "Select * From WWW_QQCF_COM_CfCount_Day_Count Where User_Name='"&User_Name&"' And AddDate=#"&Date()&"#"
Set Rs=Conn.ExeCute(Sql)
TodayTotal=Rs("Counter")
TodayIpTotal=Rs("IpCounter")
End If
If RsUser("TjOpen")=-1 Then
GGTitle="网站名称:"&Rsuser("PageName")&" "
GGTitle=GGTitle&"今天浏览:"&TodayTotal&" "
GGTitle=GGTitle&"今天IP:"&TodayIpTotal&" "
GGTitle=GGTitle&"在线人数:"&OnlineTotal&" "
GGTitle=GGTitle&"统计服务由["&RsSet("Title")&"]免费提供"
GGLink=Tmp&"View.asp?User_Name="&User_Name
Else
GGTitle=GGTitle&"统计服务由["&RsSet("Title")&"]免费提供"
GGLink=Tmp
End if
If CookieType=1 And CfCount=0 And Request.Cookies("CfCountggCookie")="" And Instr(RsSet("GGText"),"|")>0 Then
GGTitle_2=Left(RsSet("GGText"),Instr(RsSet("GGText"),"|")-1)
GGTitle=GGTitle_2&" "&GGTitle
GGLink=Mid(RsSet("GGText"),Instr(RsSet("GGText"),"|")+1,100)
End If
If CookieType=2 And CfCount=-1 And Request.Cookies("CfCountggCookie")="" And RanNum=1 And Instr(RsSet("GGText"),"|")>0 Then
GGTitle_2=Left(RsSet("GGText"),Instr(RsSet("GGText"),"|")-1)
GGTitle=GGTitle_2&" "&GGTitle
GGLink=Mid(RsSet("GGText"),Instr(RsSet("GGText"),"|")+1,100)
End If
If CfCount=0 Then
SpareTime=DateDiff("s",Date(),Date()+1)-DateDiff("s",Date(),Now())
Cookies_Time=DateAdd("s",SpareTime,Now())
Response.Cookies("CfCountCookie")=-1
Response.Cookies("CfCountCookie").Expires=Cookies_Time
End If
If CfCountVisitTotal=1 Then
Cookies_Time=DateAdd("d",365,Now())
Response.Cookies("CfCountVisitTotalCookie")=1
Response.Cookies("CfCountVisitTotalCookie").Expires=Cookies_Time
Else
If CfCount=0 Then
Cookies_Time=DateAdd("d",365,Now())
Response.Cookies("CfCountVisitTotalCookie")=CfCountVisitTotal
Response.Cookies("CfCountVisitTotalCookie").Expires=Cookies_Time
End if
End If
If RsUser("ShowType")=1 Then
Counter=RsUser("ShowTotal")
ElseIf RsUser("ShowType")=2 Then
Counter=RsUser("RealShowTotal")
ElseIf RsUser("ShowType")=3 Then
Counter=RsUser("RealIpTotal")
End if
CountLen=Len(Counter)
ZeroNum=RsUser("PicNum")-CountLen
For I=1 To ZeroNum
LinkUrl=Tmp&"QQCF_CounterPic/"&RsUser("Style")&"/0"
CounterHtm=CounterHtm&"<img src="&LinkUrl&".gif border='0'>"
Next
If RsUser("CounterShow")=-1 Then
For I=1 To CountLen
Pic=Mid(Counter,I,1)
LinkUrl=Tmp&"QQCF_CounterPic/"&RsUser("Style")&"/"&pic
CounterHtm=CounterHtm&"<img src="&LinkUrl&".gif border='0'>"
Next
CounterHtm="<a href="&GGLink&" target=_blank title="&GGTitle&">"&CounterHtm&"</a>"
Else
If RsUser("CounterHiddenPic")=1 Then
CounterHtm="<a href="&GGLink&" target=_blank title="&GGTitle&"><span style='font-size:12px;text-decoration:none;font-weight:normal;color:#000000;line-height:20px;'>"&RsSet("TjTextName")&"</span></a>"
ElseIf RsUser("CounterHiddenPic")=2 Then
CounterHtm="<a href="&GGLink&" target=_blank title="&GGTitle&"><img src="&Tmp&"QQCF_Pic/counter_2.gif border='0'></a>"
ElseIf RsUser("CounterHiddenPic")=3 Then
CounterHtm="<a href="&GGLink&" target=_blank title="&GGTitle&"><img src="&Tmp&"QQCF_Pic/counter_3.gif border='0'></a>"
End If
End If
If Action="getcount" Then
If RsUser("OnlineShow")=-1 Then
OnlineHtm="<span style='font-size:12px;text-decoration:none;font-weight:normal;color:#000000;line-height:20px;'>同时在线[<font color='#FF0000'>"&OnlineTotal&"</font>]人</span>"
End If
If RsUser("TodayShow")=-1 Then
TodayHtm="<span style='font-size:12px;text-decoration:none;font-weight:normal;color:#000000;line-height:20px;'>今天浏览[<font color='#FF0000'>"&TodayTotal&"</font>]</span>"
End If
If RsUser("TodayIpShow")=-1 Then
TodayIpHtm="<span style='font-size:12px;text-decoration:none;font-weight:normal;color:#000000;line-height:20px;'>今天IP[<font color='#FF0000'>"&TodayIpTotal&"</font>]</span>"
End If
If RsUser("IpShow")=-1 Then
IPHtm="<span style='font-size:12px;text-decoration:none;font-weight:normal;color:#000000;line-height:20px;'>你的IP[<font color='#FF0000'>"&IP&"</font>]</span>"
End If
If RsUser("VisitShow")=-1 Then
VisitHtm="<span style='font-size:12px;text-decoration:none;font-weight:normal;color:#000000;line-height:20px;'>欢迎你第[<font color='#FF0000'>"&CfCountVisitTotal&"</font>]次访问本站</span>"
End If
If RsUser("CounterSite")=1 Or RsUser("CounterSite")=2 Then
If RsUser("OnlineShow")=-1 Then AllHtm=AllHtm&OnlineHtm&"<br>"
If RsUser("TodayShow")=-1 Then AllHtm=AllHtm&TodayHtm&"<br>"
If RsUser("TodayIpShow")=-1 Then AllHtm=AllHtm&TodayIpHtm&"<br>"
If RsUser("IpShow")=-1 Then AllHtm=AllHtm&IpHtm&"<br>"
If RsUser("VisitShow")=-1 Then AllHtm=AllHtm&VisitHtm
ElseIf RsUser("CounterSite")=3 Or RsUser("CounterSite")=4 Then
If RsUser("OnlineShow")=-1 Then AllHtm=AllHtm&OnlineHtm&" "
If RsUser("TodayShow")=-1 Then AllHtm=AllHtm&TodayHtm&" "
If RsUser("TodayIpShow")=-1 Then AllHtm=AllHtm&TodayIpHtm&" "
If RsUser("IpShow")=-1 Then AllHtm=AllHtm&IpHtm&" "
If RsUser("VisitShow")=-1 Then AllHtm=AllHtm&VisitHtm
End if
If RsUser("CounterSite")=1 Then
TableCode="<table border='0' cellpadding='2' cellspacing='1'><tr><td><div align='center'>"&CounterHtm&"</div></td></tr><tr><td><div align='center'><a href="&GGLink&" target=_blank title='"&GGTitle&"' style='font-size:12px;text-decoration:none;font-weight:normal;color:#000000;line-height:20px;'>"&AllHtm&"</a></div></td></tr></table>"
ElseIf RsUser("CounterSite")=2 Then
TableCode="<table border='0' cellpadding='2' cellspacing='1'><tr><td><div align='center'><a href="&GGLink&" target=_blank title='"&GGTitle&"'>"&AllHtm&"</a></div></td></tr><tr><td><div align='center'>"&CounterHtm&"</div></td></tr></table>"
ElseIf RsUser("CounterSite")=3 Then
TableCode=CounterHtm&"<a href="&GGLink&" target=_blank title='"&GGTitle&"'>"&AllHtm&"</a>"
ElseIf RsUser("CounterSite")=4 Then
TableCode="<a href="&GGLink&" target=_blank title='"&GGTitle&"'>"&AllHtm&"</a>"&CounterHtm
End If
If RsUser("OnlineShow")=0 And RsUser("TodayShow")=0 And RsUser("TodayIpShow")=0 And RsUser("IpShow")=0 And RsUser("VisitShow")=0 Then
TableCode=CounterHtm
End If
Response.Write("document.write("& chr(34) & TableCode & chr(34) &");")
End If
If Assort=1 Then
If RsUser("ImgShowType")=1 Then
ImgCounter=RsUser("ShowTotal")
ElseIf RsUser("ImgShowType")=2 Then
ImgCounter=RsUser("RealShowTotal")
ElseIf RsUser("ImgShowType")=3 Then
ImgCounter=RsUser("RealIpTotal")
End if
ImgCountLen=Len(ImgCounter)
ImgZeroNum=RsUser("PicNum")-ImgCountLen
For I=1 To ImgZeroNum
PicText=PicText&"0"
Next
PicText=PicText&Cstr(ImgCounter)
End If
Application.Lock
Application("CfCountDo") = 0
Application.UnLock
Else
Application.Lock
Application("ErrorNum") = Int(Application("ErrorNum"))+1
Application.UnLock
End If
End If
if Assort=1 Then
Const nMaxSaturation = 100 ' 最大色彩饱和度
Const nBlankNoisyDotOdds = 0 ' 空白处噪点率
Const nColorNoisyDotOdds = 0 ' 有色处噪点率
Dim nCharCount
nCharCount = Len(PicText) ' 产生的字符个数
If RsUser("ImgCounterShow")=0 Then nCharCount=8
Const nPixelWidth = 18 ' 单个字符位图的宽度
Const nPixelHeight = 18 ' 单个字符位图的高度
Const nColorHue = -1 ' 显示验证码的色调(-1表示随机色调, -2表示灰度色调)
Const nAngleRandom = 0 ' 角度随机量
Const nLengthRandom = 0 ' 长度随机量(百分比)
Dim cCharSet
cCharSet = PicText
If RsUser("ImgCounterShow")=0 Then cCharSet="00000000"
' 构成验证码的字符集
' 如果扩充了下边的字母矢量库,则可以相应扩充这个字符集
Dim Buf(), DigtalStr
Dim Lines(), LineCount
Dim CursorX, CursorY, DirX, DirY
Randomize
Call CreatValidCode("GetCode")
Sub CDGen_Reset()
' 复位矢量笔和环境变量
LineCount = 0
CursorX = 0
CursorY = 0
' 初始的光笔方向是垂直向下
DirX = 0
DirY = 1
End Sub
Sub CDGen_Clear()
' 清空位图阵列
Dim i, j
ReDim Buf(nPixelHeight - 1, nCharCount * nPixelWidth - 1)
For j = 0 To nPixelHeight - 1
For i = 0 To nCharCount * nPixelWidth - 1
Buf(j, i) = 0
Next
Next
End Sub
Sub CDGen_PSet(X, Y)
' 在位图阵列上画点
Buf(Y, X) = 1
End Sub
Sub CDGen_Line(X1, Y1, X2, Y2)
' 在位图阵列上画线
Dim DX, DY, DeltaT, i
DX = X2 - X1
DY = Y2 - Y1
If Abs(DX) > Abs(DY) Then DeltaT = Abs(DX) Else DeltaT = Abs(DY)
For i = 0 To DeltaT
CDGen_PSet X1 + DX * i / DeltaT, Y1 + DY * i / DeltaT
Next
End Sub
Sub CDGen_FowardDraw(nLength)
' 按当前光笔方向绘制指定长度并移动光笔,正数表示从左向右/从上向下绘制,负数表示从右向左/从下向上绘制
nLength = Sgn(nLength) * Abs(nLength) * (1 - nLengthRandom / 100 + Rnd * nLenghtRandom * 2 / 100)
ReDim Preserve Lines(3, LineCount)
Lines(0, LineCount) = CursorX
Lines(1, LineCount) = CursorY
CursorX = CursorX + DirX * nLength
CursorY = CursorY + DirY * nLength
Lines(2, LineCount) = CursorX
Lines(3, LineCount) = CursorY
LineCount = LineCount + 1
End Sub
Sub CDGen_SetDirection(nAngle)
' 按指定角度设定画笔方向, 正数表示相对当前方向顺时针改变方向,负数表示相对当前方向逆时针改变方向
Dim DX, DY
nAngle = Sgn(nAngle) * (Abs(nAngle) - nAngleRandom + Rnd * nAngleRandom * 2) / 180 * 3.1415926
DX = DirX
DY = DirY
DirX = DX * Cos(nAngle) - DY * Sin(nAngle)
DirY = DX * Sin(nAngle) + DY * Cos(nAngle)
End Sub
Sub CDGen_MoveToMiddle(nActionIndex, nPercent)
' 将画笔光标移动到指定动作的中间点上,nPercent为中间位置的百分比
Dim DeltaX, DeltaY
DeltaX = Lines(2, nActionIndex) - Lines(0, nActionIndex)
DeltaY = Lines(3, nActionIndex) - Lines(1, nActionIndex)
CursorX = Lines(0, nActionIndex) + Sgn(DeltaX) * Abs(DeltaX) * nPercent / 100
CursorY = Lines(1, nActionIndex) + Sgn(DeltaY) * Abs(DeltaY) * nPercent / 100
End Sub
Sub CDGen_MoveCursor(nActionIndex)
' 将画笔光标移动到指定动作的起始点上
CursorX = Lines(0, nActionIndex)
CursorY = Lines(1, nActionIndex)
End Sub
Sub CDGen_Close(nActionIndex)
' 将当前光笔位置与指定动作的起始点闭合并移动光笔
ReDim Preserve Lines(3, LineCount)
Lines(0, LineCount) = CursorX
Lines(1, LineCount) = CursorY
CursorX = Lines(0, nActionIndex)
CursorY = Lines(1, nActionIndex)
Lines(2, LineCount) = CursorX
Lines(3, LineCount) = CursorY
LineCount = LineCount + 1
End Sub
Sub CDGen_CloseToMiddle(nActionIndex, nPercent)
' 将当前光笔位置与指定动作的中间点闭合并移动光笔,nPercent为中间位置的百分比
Dim DeltaX, DeltaY
ReDim Preserve Lines(3, LineCount)
Lines(0, LineCount) = CursorX
Lines(1, LineCount) = CursorY
DeltaX = Lines(2, nActionIndex) - Lines(0, nActionIndex)
DeltaY = Lines(3, nActionIndex) - Lines(1, nActionIndex)
CursorX = Lines(0, nActionIndex) + Sgn(DeltaX) * Abs(DeltaX) * nPercent / 100
CursorY = Lines(1, nActionIndex) + Sgn(DeltaY) * Abs(DeltaY) * nPercent / 100
Lines(2, LineCount) = CursorX
Lines(3, LineCount) = CursorY
LineCount = LineCount + 1
End Sub
Sub CDGen_Flush(X0, Y0)
' 按照当前的画笔动作序列绘制位图点阵
Dim MaxX, MinX, MaxY, MinY
Dim DeltaX, DeltaY, StepX, StepY, OffsetX, OffsetY
Dim i
MaxX = MinX = MaxY = MinY = 0
For i = 0 To LineCount - 1
If MaxX < Lines(0, i) Then MaxX = Lines(0, i)
If MaxX < Lines(2, i) Then MaxX = Lines(2, i)
If MinX > Lines(0, i) Then MinX = Lines(0, i)
If MinX > Lines(2, i) Then MinX = Lines(2, i)
If MaxY < Lines(1, i) Then MaxY = Lines(1, i)
If MaxY < Lines(3, i) Then MaxY = Lines(3, i)
If MinY > Lines(1, i) Then MinY = Lines(1, i)
If MinY > Lines(3, i) Then MinY = Lines(3, i)
Next
DeltaX = MaxX - MinX
DeltaY = MaxY - MinY
If DeltaX = 0 Then DeltaX = 1
If DeltaY = 0 Then DeltaY = 1
MaxX = MinX
MaxY = MinY
If DeltaX > DeltaY Then
StepX = (nPixelWidth - 2) / DeltaX
StepY = (nPixelHeight - 2) / DeltaX
OffsetX = 0
OffsetY = (DeltaX - DeltaY) / 2
Else
StepX = (nPixelWidth - 2) / DeltaY
StepY = (nPixelHeight - 2) / DeltaY
OffsetX = (DeltaY - DeltaX) / 2
OffsetY = 0
End If
For i = 0 To LineCount - 1
Lines(0, i) = Round((Lines(0, i) - MaxX + OffsetX) * StepX, 0)
If Lines(0, i) < 0 Then Lines(0, i) = 0
If Lines(0, i) >= nPixelWidth - 2 Then Lines(0, i) = nPixelWidth - 3
Lines(1, i) = Round((Lines(1, i) - MaxY + OffsetY) * StepY, 0)
If Lines(1, i) < 0 Then Lines(1, i) = 0
If Lines(1, i) >= nPixelHeight - 2 Then Lines(1, i) = nPixelHeight - 3
Lines(2, i) = Round((Lines(2, i) - MinX + OffsetX) * StepX, 0)
If Lines(2, i) < 0 Then Lines(2, i) = 0
If Lines(2, i) >= nPixelWidth - 2 Then Lines(2, i) = nPixelWidth - 3
Lines(3, i) = Round((Lines(3, i) - MinY + OffsetY) * StepY, 0)
If Lines(3, i) < 0 Then Lines(3, i) = 0
If Lines(3, i) >= nPixelHeight - 2 Then Lines(3, i) = nPixelHeight - 3
CDGen_Line Lines(0, i) + X0 + 1, Lines(1, i) + Y0 + 1, Lines(2, i) + X0 + 1, Lines(3, i) + Y0 + 1
Next
End Sub
Sub CDGen_Char(cChar, X0, Y0)
' 在指定坐标处生成指定字符的位图阵列
CDGen_Reset
Select Case cChar
Case "0"
CDGen_SetDirection -60 ' 逆时针60度(相对于垂直线)
CDGen_FowardDraw -0.7 ' 反方向绘制0.7个单位
CDGen_SetDirection -60 ' 逆时针60度
CDGen_FowardDraw -0.7 ' 反方向绘制0.7个单位
CDGen_SetDirection 120 ' 顺时针120度
CDGen_FowardDraw 1.5 ' 绘制1.5个单位
CDGen_SetDirection -60 ' 逆时针60度
CDGen_FowardDraw 0.7 ' 绘制0.7个单位
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -