Description :
This function used to trap the visitors IP address and Visited file.
this will write the user IP address and Visited files in one text
file (named nb_log.txt).
Session variables are assigned at login time.
ASP Code :
Function writeLog(line)
Dim FSO, myFile
set FSO = Server.CreateObject("scripting.FileSystemObject")
set myFile = fso.OpenTextFile("C:\Inetpub\wwwroot\nb_log.txt", 8,
true)
myFile.WriteLine(line)
myFile.Close
End function
Dim tmpFileName, fileName, line
tmpFileName = Split(Request.ServerVariables("URL"), "/")
fileName = tmpFileName(UBound(tmpFileName))
line = "UID: "& Session("User_ID")
line = line &", FName: "& fileName
line = line &", FPath: "& Session("nb_p_path")
line = line &", DT: "& Now()
line = line &", IP: "& Request.ServerVariables("REMOTE_ADDR")
line = line &", Agent: "& Request.ServerVariables("HTTP_USER_AGENT")
line = line &", Local Address: "& Request.ServerVariables("LOCAL_ADDR")
Call writeLog(line) ' calling the Function