出来るのだASP Q&A掲示板(過去LOG)
訪問数 52046
昨日 889
今日 776 【PR】 パソコン入門からIT専門書まで幅広く取り揃えています。セブン-イレブン受取り手数料無料のセブンアンドワイ。 |
![]() ![]() ![]() ![]() ![]() |
[4056] Re:アクセスカウンタ |
投稿者:Lightningさん 2004/02/10 9:17:24 |
> >クッキーに最終アクセス時間を保持させてもいいし、ファイルにIPなりホストネームと共に保持してもいいね > > 力不足のため、このやり方がわかりません。。 > (いろいろ調べてはいるのですが・・) クッキーに最終アクセスタイムを保存するなら Response.Cookies("LastAccessTime") = now でいいし (読むときはRequest.Cookies("LastAccessTime")) IPの取得はYasさんのサンプルとかを見れば一目瞭然かと・・・ 一応、クッキーナサンプルを・・・ かなり適当でカウントをクッキーに保存してますが、これで1時間ごとにアクセスがあればカウントアップするはず <% dim LATime,count count = 0 if Request.Cookies("count") <> "" then count = Request.Cookies("count") LATime = Request.Cookies("LastAccessTime") end if response.write "<p>" & LATime response.write "<p>" & now if Year(LATime) >= Year(now) then if Month(LATime) >= Month(now) then if Day(LATime) >= Day(now) then if hour(LATime) >= hour(now) then else count = count + 1 response.Cookies("count") = count response.Cookies("LastAccessTime") = now end if end if end if end if response.write count %> |
![]() ![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
TreeBBS For ASP V.0.1.3 |