用友|用 ASP 编写简单的日流量,最大日流量统计

更新时间:2014-07-02    来源:    手机版     字体:

【www.bbyears.com--春】

用 ASP 编写简单的日流量,最大日流量统计
-----------------------------------------------------------------------------
<%
"#########- 统计今日流量,最大日流量 -##########
Sub My_Today_Counter()
day1 = cstr(date()) "######- 获得当前日期
Day_Counter_File = Server.MapPath("Counter/Day_counter.ini") "######- 指定计数器文件
set fo = Server.CreateObject("scripting.filesystemobject")
set get_old = fo.OpenTextFile( Day_Counter_File,1,false,false) "######- 读取记录文件
day2 = get_old.ReadLine
Today_Counter = get_old.ReadLine
get_old.close
Application("Todays") = Today_Counter
Set out = fo.CreaTetextFile( Day_Counter_File,true,false )
if day1 = day2 then "#######- 写入今日流量
out.WriteLine( day2 )
Today_Counter = Today_Counter + 1
out.writeline( Today_Counter )
out.Close
Else "######- 新的一天,总结最大日流量
Max_Day_Counter_File = server.mappath("counter/Max_Day_Counter.ini")
Set OutMax = fo.OpenTextFile( Max_Day_Counter_File,1,false,false)
day3 = OutMax.Readline
MaxDayCounter = OutMax.ReadLine "######- 读取最大日流量记录
OutMax.Close
Application("MaxDay") = MaxDayCounter "######- 最大日流量
if Today_Counter-MaxDayCounter>0 then "######- 昨日流量大于最大日流量记录
Application("MaxDay") = Today_Counter "######- 最大日流量
Set OutMax = fo.createtextfile(Max_Day_Counter_File,true,false)
OutMax.WriteLine( day2 ) "######- 如果 day2 有最大日流量
OutMax.WriteLine( Today_Counter ) "######- 写入最大日流量记录
OutMax.Close
End If
Out.WriteLine( day1 ) "######- 创建新一天的日流量统计文件
Today_Counter = 1
out.WriteLine( Today_Counter )

本文来源:http://www.bbyears.com/zhufuduanxin/7500.html

热门标签

更多>>

本类排行