|
-
Sep 18th, 2000, 03:15 PM
#1
Thread Starter
Lively Member
I'm in the middle of doing a simple Blackboard/Message board system for use in work. It's pretty much done apart from the final part that the bosses want done which involves creating a log file stating who read the messages including date and time. The date and time is easy enough but I'm not sure how to identify who's read the message. The only way that I can think of is to use everyones WinNT Logon, but I'm not quite sure how to do this.
So basically what I want to do is creat a text log file in the following format:
"(User) read the message at (Time)(date)"
Any help or suggestions on how I can do this would be appreciated.
Cheers
The problem with designing something completely foolproof is to underestimate the ingenuity of a complete fool. - Douglas Adams
I know the human being and fish can coexist peacefully. - GWB
I think we agree, the past is over. - GWB
-
Sep 18th, 2000, 03:24 PM
#2
Addicted Member
You have to use the API.
Private Declare Function win32_nlWNetGetUserA Lib "mpr.dll" Alias "WNetGetUserA" (ByVal lpName As String, ByVal lpUserName As String, lpnLength As Long) As Long
Public Function duwinsys_sWNetGetUser() As String
'Retrieve the logged-in username.
Dim nPos As Integer
Dim nlBufLength As Long
Dim sUserId As String
sBuf As String
sUserId = ""
sBuf = Space$(256)
nlBufLength = Len(sBuf)
If win32_nlWNetGetUserA("", sBuf, nlBufLength) = 0 Then
nPos = InStr(sBuf, Chr$(0))
If nPos > 0 Then
sUserId = Left$(sBuf, nPos - 1)
Else
sUserId = sBuf
End If
End If
duwinsys_sWNetGetUser = sUserId
End Function
-
Sep 19th, 2000, 12:26 PM
#3
Thread Starter
Lively Member
Thanks very much!!
Cheers HDR, I'll give that a go.
I hate to be a nuisance but I don't suppose there's away to do this Win 98 also, cos I just been told that there are a few Win98 machines in here also.
Cheers
The problem with designing something completely foolproof is to underestimate the ingenuity of a complete fool. - Douglas Adams
I know the human being and fish can coexist peacefully. - GWB
I think we agree, the past is over. - GWB
-
Sep 19th, 2000, 12:29 PM
#4
Addicted Member
I believe that this works in '98 also.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|