Norman Diamond responded with this to a very similar question on the C#
board. It should apply to VB as well.
================
There can be 0 or more current logged in users. If you want all of the 0 or
1 users who are currently logged in at the console then P/Invoke to
WTSGetActiveConsoleSessionId and WTSQuerySessionInformation. If you want
all of the users then you'll need to call WTSQuerySessionInformation in a
loop.
Warning: Only call the Unicode version of WTSQuerySessionInformation. If
your application runs in ANSI then explicitly call the Unicode version
WTSQuerySessionInformationW and convert the result to ANSI by calling
WideCharToMultiByte. From C# you mostly don't have to worry about this,
just make sure that your P/Invoke declaration specifies the Unicode version.
================
"Steven" wrote:
Hi Gurus,
Is there any way to find out all the useres currently logged on my machine.
I am using framework 2.0 with VB.
I'll appreciate any help I get.
Thanks, Steven.