学校生活

学校生活

入学をお考えの方に

その他

<% Set objFile = Server.CreateObject("Scripting.FileSystemObject") sPathCountFile1 = Server.MapPath("count1.dat") sPathCountFile = Server.MapPath("count2.dat") On Error Resume Next Set strmFile = objFile.OpenTextFile(sPathCountFile, 1, FALSE) If Err.Number > 0 Then '***** 初回起動? iCount = 0 dtOld = Date() iCountT = 0 iCountY = 0 Else '***** カウントファイルの読み込み iCount = strmFile.ReadLine dtOld = CDate(strmFile.ReadLine) iCountT = strmFile.ReadLine iCountY = strmFile.ReadLine End If '***** カウント処理 If dtOld <> Date() Then '***** 日付が変わった? Set strmFile1 = objFile.OpenTextFile(sPathCountFile1, 8, TRUE) strmFile1.Write dtOld & "," & iCountT & chr(13) & chr(10) strmFile1.Close dtOld = Date() iCountY = iCountT iCountT = 0 End If iCount = iCount + 1 iCountT = iCountT + 1 strmFile.Close '***** カウントファイルへ書き込み Set strmFile = objFile.OpenTextFile(sPathCountFile, 2, TRUE) strmFile.WriteLine iCount strmFile.WriteLine dtOld strmFile.WriteLine iCountT strmFile.WriteLine iCountY strmFile.Close '履歴の記録 Set objFile = Server.CreateObject("Scripting.FileSystemObject") sPathCountFile = Server.MapPath("rireki.txt") Set strmFile = objFile.OpenTextFile(sPathCountFile, 8, TRUE) strmFile.WriteLine Request.ServerVariables("HTTP_REFERER") & "," & Request.ServerVariables("REMOTE_ADDR") & "," & formatdatetime(now(),2) & "," & formatdatetime(now(),4) strmFile.Close %>