婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > 用ASP創建日志文件(附源程序)

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

熱門標簽:世界地圖標注了哪些城市 石家莊慧營銷外呼系統 梧州市地圖標注 濟源電銷外呼系統線路 創意電話機器人 地圖標注陽江 外呼線路批發 武穴地圖標注 java外呼系統是什么
這個例子使用文本文件來寫入用戶的信息創建一個logfile.asp放在每一個asp的頁面的頂端!--#Include File="LogFile.asp"-->當有人來訪問你的站點logfile.asp自動把他的信息寫入LogFile.txt,如果相關的URl一樣的話則不寫入文件
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
%>

標簽:揭陽 唐山 淮北 滁州 南寧 甘南 迪慶 來賓

巨人網絡通訊聲明:本文標題《用ASP創建日志文件(附源程序)》,本文關鍵詞  用,ASP,創建,日志,文件,附,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《用ASP創建日志文件(附源程序)》相關的同類信息!
  • 本頁收集關于用ASP創建日志文件(附源程序)的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 灯塔市| 雷山县| 安顺市| 阜城县| 钟祥市| 高州市| 虎林市| 彝良县| 临武县| 富源县| 泸西县| 仪陇县| 咸宁市| 禄丰县| 嵊州市| 庄河市| 田阳县| 南木林县| 阿拉善左旗| 外汇| 鲁山县| 兴山县| 张家港市| 灯塔市| 海盐县| 红河县| 慈溪市| 铜梁县| 东乡县| 蛟河市| 凤城市| 揭东县| 乾安县| 平潭县| 奇台县| 石阡县| 屏东县| 华阴市| 焉耆| 郧西县| 东乌珠穆沁旗|