<%@LANGUAGE="VBScript"%> <% '******** Reliability Top Page Counter (Inline Frame) ********* '---**-- Set year & month --**--- TY = Year(Now) TM = Month(Now) '---**-- Session Process --**--- '----- Check Session ------ If Session.Contents("rel_top") <> TY & "/" & TM Then '----- Write Session ----- Session.Contents("rel_top") = TY & "/" & TM '--**--- Read & Write Total Counter ---**-- Set cntObj = Server.CreateObject("Scripting.FileSystemObject") cntPath = Server.MapPath("total_top.dat") On Error Resume Next '--- Read Total Counter Set cntFile = cntObj.OpenTextFile(cntPath,1,True) TotalCnt = cntFile.ReadLine cntFile.Close TotalCnt = TotalCnt +1 '--- Write Total Counter --- Set cntFile = cntObj.OpenTextFile(cntPath,2,True) cntFile.WriteLine TotalCnt cntFile.Close '--**--- Read & Write Monthly Counter ---**-- mntPath = Server.MapPath("month_top.dat") On Error Resume Next '--- Read Monthly Counter --- Set mntFile = cntObj.OpenTextFile(mntPath,1,True) Dim MCnt(60) CT=0 Do While Not mntFile.AtEndOfStream aryStr = Split(mntFile.ReadLine,",") If FormatNumber(aryStr(0)) = FormatNumber(TY) And FormatNumber(aryStr(1)) = FormatNumber(TM) Then CNT=aryStr(2) +1 Match=1 Else CNT=aryStr(2) End If MCnt(CT) = aryStr(0) & "," & aryStr(1) & "," & CNT CT = CT +1 Loop mntFile.Close If Match <> 1 Then MCnt(CT) = TY & "," & TM & ",1" CT=CT+1 End If '--- Write Monthly Counter --- Set mntFile = cntObj.OpenTextFile(mntPath,2,True) For NM=0 To CT-1 Step 1 mntFile.WriteLine MCnt(NM) Next mntFile.Close End If 'End of Check Session %>