    '**************************************
    ' Name: IP Logging Script
    ' Description:Logs the user's ip address
    '     , NT login name, and the time. Usefull f
    '     or keeping track of the users that log o
    '     nto a protected page (i.e. remote admin 
    '     page). Just create a text file anywhere 
    '     on your server, and replace the path in 
    '     the line Set file = fs.OpenTextFile("c:\
    '     yourfile.txt", 8) with the path to your 
    '     text file. It then appends the following
    '     to the text file- User [NT LOGIN NAME] l
    '     ogged in at [THE TIME] with the ip of [R
    '     EMOTE IP ADDRESS]. Tip: Put at the begin
    '     ing of the page so that it logs before i
    '     t displays anything.
    ' By: Paul Morgan
    '
    ' Returns:Output to a text file.
    '
    ' Assumes:The file with the script inclu
    '     ded into it must have the extension .asp
    '     or the script will not run.
    '
    ' Side Effects:This script appends to a 
    '     text file, so it won't permanantly damag
    '     e anything if you type in the wrong name
    '     .
    '
    'This code is copyrighted and has    ' limited warranties.Please see http://w
    '     ww.Planet-Source-Code.com/vb/scripts/Sho
    '     wCode.asp?txtCodeId=8389&lngWId=4    'for details.    '**************************************
    
    <% 
    '---Begin ip logging script---
    'Take the user's ip and time and write i
    '     t to a text file
    'elsewhere on the server.
    'IP Logging script is copyrighted materi
    '     al of Paul Morgan
    
    'Initalize the file system object and op
    '     en the text file
    Dim fs, file
    Set fs = Server.CreateObject("Scripting.FileSystemObject")
    Set file = fs.OpenTextFile("c:\yourfile.txt", 8)
    
    'Put our ip, time, the user name, and al
    '     l the words into variables
    Dim wuser
    wuser= "User "
    Dim user
    user = Request.ServerVariables("AUTH_USER")
    Dim wlogged
    wlogged = " logged In at "
    Dim time
    time = now()
    Dim wip
    wip = " With the ip of "
    Dim ip
    ip = Request.ServerVariables("REMOTE_ADDR")
    Dim pd
    pd = " ."
    
    'Write the line!
    file.writeline(wuser &user &wlogged &time &wip &ip &pd)
    
    'Clean up
    file.close
    Set file = NOTHING
    Set fs = NOTHING
    '---End ip logging script--- 
    %>