This is a simple program that will detect the username, date and time everytime a user logs in to his computer.
API Declarations
'this folder. In the form you need not create any componets just
'write the code.In form properties make -- Visible -False.
'Then create a exe of the project. Keep this exe in 'Startup' folder
'of your computer.It will work. Each time your computer is opened
'a log record will be kept in the 'log.fil' file.
'View this file using notepad or any word editor.
'--------------------------
'Place the following code under a Module
'--------------------------
Public Declare Function GetUserNameA Lib "advapi32.dll" (ByVal lpBuffer As String, nSize As Long) As Long
Public Function GetUserName() As String
Dim UserName As String * 255
Call GetUserNameA(UserName, 255)
GetUserName = Left$(UserName, InStr(UserName, Chr$(0)) - 1)
End Function