设为首页】 【加入收藏】 【网站地图】 【商品折扣
娱乐一生 娱乐明星
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
首页  |  java  |  .NET  |  C/C++  |  网页技术  |  php  |  asp  |  delphi  |  VC  |  VB开发  |  游戏开发  |  软件工程  |  Power Builder  |  Linux开发  |  Windows开发技巧
当前位置:首页 >> ASP实例 >> 用ASP创建日志文件(附源程序)_ASP实例_src119.com

用ASP创建日志文件(附源程序)_ASP实例_src119.com -

你是否有时想知道什么人访问你的站点,什么时间,IP地址等。下面我就这个问题向
大家来阐述一下。这个例子使用文本文件来写入用户的信息创建一个logfile.a 放
在每一个a 的页面的顶端<!--#Include File="LogFile.a quot;-->当有人来访问你
的站点logfile.a 自动把他的信息写入LogFile.txt,如果相关的URl一样的话则不
写入文件
File: LogFile.a 

<%
Dim ValidEntry ' Log variable
' First set that this log is valid
ValidEntry = True

' If Se ion Variable "LogI quot; is not empty
' that mean this person has already been logged
' then set ValidLog to False
If not IsEmpty(Se ion("LogI quot;)) then ValidEntry = False

' Here you can add different restriction
' If the refering url is from same site
' don't write to log file
If Left(Request.ServerVariables("HTTP_REFERER"), 17)
="http://deva .com" Then
ValidEntry = False
End if
If Left(Request.ServerVariables("HTTP_REFERER"), 21)
="http://www.deva .com" Then
ValidEntry = False
End If

' Now if ValidEntry is True then enter to log file
If ValidEntry Then
Co t ForA ending = 8
Co t Create = true
Dim FSO
DIM TS
DIM MyFileName
Dim strLog

MyFileName = Server.Ma ath("MyLogFile.txt")
Set FSO = Server.CreateObject(" cripting.FileSystemObject")
Set TS = FSO.OpenTextFile(MyFileName, ForA ending, Create)

' Store all required values in strLog
strLog = " lt r> lt gt lt gt quot; &am  now &am  " lt;/ gt; "
strLog = strLog &am  Request.ServerVariables("REMOTE_ADDR") &am  " "
strLog = strLog &am  Request.ServerVariables("HTTP_REFERER") &am  " "
strLog = strLog &am  Request.ServerVariables("HTTP_USER_AGENT") &am  " lt R> quot;
' Write current information to Log Text File.
TS.write strLog
TS.Writeline " quot;
' Create a se ion varialbe to check next time for ValidEntry
Se ion("LogI quot;) = "ye quot;
Set TS = Nothing
Set FSO = Nothing
End If
%> 




 

娱乐图摘

更多 >>

靓丽清纯美女meimei

美女私房全裸照
导演劝女演员脱衣服(视频)

大胆火辣人体艺术写真(图)

黑丝妹妹热辣诱惑-丝袜美女妹妹

PLMM 漂亮妹妹图集-妹妹图库

全球美女图库-美女集中营

52MM 我爱漂亮妹妹-制服妹妹诱惑

图王图库-世界美女明星图片资料库
美女写真集锦

激情两性-解密性生活
浴室MM湿身内衣诱惑
邻家小妹洗澡被偷拍(视频)

热点文章

更多

· XMLHTTP+Javascript+Asp写得聊天室,无刷
· 让您的主页支持各种浏览设备(ASP+篇)(下)_ASP实例_
· 将你的网站设置为客户的信任站点--WSH方案_ASP实例_s
· W3 Jmail中文使用说明_ASP实例_src119.co
· 利用XSL和ASP在线编辑XML文档_ASP实例_src11
· 一种在线人数统计方法(只用1个APPLICATION)_AS
· aspemail组件的应用_ASP实例_src119.com
· ASP连接执行程序 _ASP实例_src119.c
· 嵌入式Web视频点播系统实现方法_ASP实例_src119.
· 利用ASP实现三个强大功能之三_ASP实例_src119.c

热点文章

更多