<% strFileName = Server.MapPath("count-net.dat") strNotPlus1 = "127.0.0.1" On Error Resume Next Set FileObject = Server.CreateObject("Scripting.FileSystemObject") Set InStream = FileObject.OpenTextFile(strFileName, 1, False, False) If Err.Number > 0 then intCountSum = 0 intCountYesterday = 0 intCountToday = 0 dtmLastAccess = date dtmStartAccess = date Else for i=1 to 5 if i = 1 then intCountSum = InStream.ReadLine '累計 elseif i = 2 then intCountToday = InStream.ReadLine '今日のアクセス数 elseif i = 3 then intCountYesterday = InStream.ReadLine '昨日のアクセス数 elseif i = 4 then dtmLastAccess = InStream.ReadLine '最終アクセス日付 elseif i = 5 then dtmStartAccess = InStream.ReadLine 'アクセス開始日付 End If Next InStream.Close End If dtmNow = date dtmLastAccess = CDate(dtmLastAccess) if dtmNow - dtmLastAccess = 1 then intCountYesterday = intCountToday intCountToday = 0 dtmLastAccess = dtmNow elseif dtmNow - dtmLastAccess > 1 Then intCountYesterday = 0 intCountToday = 0 dtmLastAccess = dtmNow end if strRemoteAddress = Request.ServerVariables("REMOTE_ADDR") if Not strRemoteAddress = strNotPlus1 then intCountSum = intCountSum + 1 intCountToday = intCountToday + 1 end if Set OutStream = FileObject.CreateTextFile(strFileName, True, False) OutStream.WriteLine intCountSum & Chr(10) & intCountToday & Chr(10) & intCountYesterday & Chr(10) & dtmLastAccess & Chr(10) & dtmStartAccess & Chr(10) OutStream.Close %>