Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create log file using interdev

Status
Not open for further replies.

antonyb

MIS
Aug 23, 2002
35
MY
greetings,

How to create a log file for keeping track of users who have logged in to this page.

can somebody give some sample or any tutorials.

thanks
 
If you are familiar with Asp you could a scripting object (TextStream object) to create a log file.
Use this code as a server side include file
<%
Const ForAppending = 8
Dim strLogFileName
strLogFileName = &quot;c:\.....&quot; 'your path here

dim objlogFile
set objlogFile = createObject(&quot;Scripting.FileSystemObject&quot;)

Dim objLogFileTS
If objLogFile.FileExists(strLogName) Then
Set oblLogFileTS = objLogFileFSO.OpenTextFile(strLogFileName, ForAppending)

Else
Set objLogFileTS = objLogFileFSO.CreateTextFile(strLogFileName)
End if

'the following subroutine will write the information into your log file

sub WriteToLog(strNewEntry)
Dim strLogEntry
strLogEntry = formatDateTime(now) & &quot;-&quot;
strLogEntry = strLogEntry & strNewEntry
objLogFiltTS.WriteLine strLogEntry
End Sub

Sub CloseLog()
objLogFileTS.Close
end Sub
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top