Thread: create log file
View Single Post
  #2 (permalink)  
Old 05-20-2008, 03:24 PM
scsefrmr scsefrmr is offline
Learning Programmer
 
Join Date: May 2008
Posts: 39
Credits: 0
Rep Power: 3
scsefrmr is on a distinguished road
Send a message via MSN to scsefrmr
Default Re: create log file

Hi yonghan,

For creating a log, you could open a file for output and print the information to it as it passes various parts of the application.

Code:
'-- Open a file for output --|
Open "c:\access.log" for output as #1
.................
.................
.................
'-- Set a variable to hold the text going into the log file --|
strTemp = << stuff to go into the log file >>
'-- Send variable into the log file --|
Print #1, strTemp
.................
.................
'-- And at the end, close the file --|
Close #1

If the client is accessing the server via Winsock (if the application is a Windows based app rather than a web application on a website), then you could get the users IP via the Winsock object on the server form... a la Winsock1.RemoteHostIP (if I remember right?)
And you can write that to the log file in the same way as above
Reply With Quote