国产成人精品18p,天天干成人网,无码专区狠狠躁天天躁,美女脱精光隐私扒开免费观看

用ASP創(chuàng )建日志文件(附源程序)

發(fā)布時(shí)間:2021-08-17 12:10 來(lái)源: 閱讀:0 作者: 欄目: ASP 歡迎投稿:712375056

這個(gè)例子使用文本文件來(lái)寫(xiě)入用戶(hù)的信息創(chuàng )建一個(gè)logfile.asp放在每一個(gè)asp的頁(yè)面的頂端<!--#Include File="LogFile.asp"-->當有人來(lái)訪(fǎng)問(wèn)你的站點(diǎn)logfile.asp自動(dòng)把他的信息寫(xiě)入LogFile.txt,如果相關(guān)的URl一樣的話(huà)則不寫(xiě)入文件
File: LogFile.asp
代碼如下:
<%
Dim ValidEntry ' Log variable
' First set that this log is valid
ValidEntry = True

' If Session Variable "LogIn" is not empty
' that mean this person has already been logged
' then set ValidLog to False
If not IsEmpty(Session("LogIn")) 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://jb51.net" Then
ValidEntry = False
End if
If Left(Request.ServerVariables("HTTP_REFERER"), 21)
="https://www.jb51.net" Then
ValidEntry = False
End If

' Now if ValidEntry is True then enter to log file
If ValidEntry Then
Const ForAppending = 8
Const Create = true
Dim FSO
DIM TS
DIM MyFileName
Dim strLog

MyFileName = Server.MapPath("MyLogFile.txt")
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Set TS = FSO.OpenTextFile(MyFileName, ForAppending, Create)

' Store all required values in strLog
strLog = "<br><P><B>" & now & "</B> "
strLog = strLog & Request.ServerVariables("REMOTE_ADDR") & " "
strLog = strLog & Request.ServerVariables("HTTP_REFERER") & " "
strLog = strLog & Request.ServerVariables("HTTP_USER_AGENT") & "<BR>"
' Write current information to Log Text File.
TS.write strLog
TS.Writeline ""
' Create a session varialbe to check next time for ValidEntry
Session("LogIn") = "yes"
Set TS = Nothing
Set FSO = Nothing
End If
%>

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自本網(wǎng)站內容采集于網(wǎng)絡(luò )互聯(lián)網(wǎng)轉載等其它媒體和分享為主,內容觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如侵犯了原作者的版權,請告知一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容,聯(lián)系我們QQ:712375056,同時(shí)歡迎投稿傳遞力量。

又黄又硬又湿又刺激视频免费| αv天堂在线观看免费| 爱情岛网站亚洲禁18进入| 久久久国产精品一区二区18禁| 天天摸天天透天天添| 亚洲第一极品精品无码 |