|
-
Jun 4th, 2001, 02:10 PM
#1
Thread Starter
Junior Member
How do I find usernames?
Does anyone know how to tell who's logged onto a windows NT environment, and how they wrote their username when they logged on?
like you would have a listbox filled with usernames.
and if they typed in: UsErNaMe it would say that instead of Username.
Anyone.
I haven't been able to get on in a while, the new webpage wouldn't work
-
Jun 4th, 2001, 02:34 PM
#2
Black Cat
VB Code:
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, nsize As Long) As Long
Private Sub Command1_Click()
' Display the name of the user currently logged on.
Dim username As String ' receives name of the user
Dim slength As Long ' length of the string
Dim retval As Long ' return value
' Create room in the buffer to receive the returned string.
username = Space(255) ' room for 255 characters
slength = 255 ' initialize the size of the string
' Get the user's name and display it.
retval = GetUserName(username, slength) ' slength is now the length of the returned string
username = Left(username, slength - 1) ' extract the returned info from the buffer
' (We subtracted one because we don't want the null character in the trimmed string.)
Text1.Text = username
End Sub
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Jun 4th, 2001, 02:45 PM
#3
Thread Starter
Junior Member
No, that isn't exactly what I meant.
I was referring to the other users on at the same time.
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
|