• Welcome, Guest. Please login.
 

Would someone please test fredpaul.exe + IPAddress (remote client)

Started by mikedoty, August 28, 2008, 03:32:41 PM

Previous topic - Next topic

mikedoty

Wouild someone please test this remote client?
Should run from any folder and with or without installation!

http://www.dotysoftware.com/sqlite/fredpaul.exe
Syntax:  fredpaul.exe  space + Optional IP Address (if you have your own server running)

This is about as simple as it can get.

mikedoty

Thank you, dbk!
IP addresses show up in the log file as it is used.
What do you think?

David Kenny

Worked rather well.  Not knowing much about it, it seemed quick enough.  Will you be releasing the source?

PS Your program sends username to the log file also?

David Kenny


mikedoty

REM  SQLiteningServer.Bas    you control all the source code

So nobody gets confused,  this code was written by Fred Meier, not me.


SUB LogIt(rsEntry AS STRING)

   LOCAL llA AS LONG
   LOCAL lsA AS STRING

   %LogFileMaxSize = 600000
   %LogFileTrimSize = 100000

   ' Enter critical and open log file
   EnterCriticalSection guCriticalSection
   OPEN "SQLiteningServer.Log" FOR APPEND AS glLogFileNumber

   ' Put entry
   PRINT #glLogFileNumber, REMOVE$(RIGHT$(DATE$, 2) & LEFT$(DATE$, 5) & TIME$, ANY "-:") & " " & rsEntry

   ' Check if it is time to trim the log
   IF ISFALSE (glFlags AND %gbfTrimLogManually) AND LOF(glLogFileNumber) > %LogFileMaxSize THEN
      CLOSE glLogFileNumber
      OPEN "SQLiteningServer.Log" FOR BINARY AS glLogFileNumber
      SEEK glLogFileNumber, %LogFileTrimSize
      GET$ glLogFileNumber, LOF(glLogFileNumber) - %LogFileTrimSize + 1, lsA
      llA = INSTR(lsA, $CRLF) + 2
      SEEK glLogFileNumber, 1
      PUT$ glLogFileNumber, MID$(lsA, llA)
      SETEOF glLogFileNumber
   END IF

   ' Close log file and leave critical
   CLOSE glLogFileNumber
   LeaveCriticalSection guCriticalSection

END SUB