Information about the current logged user !

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hey guys,

small question. Can I find out if the current logged on use is a local
user or a domain user ?
And please don't use any solution that uses String parsing...

What I need is to get the display name of the current user and the
only way I'm able to do this is using a DLL wrapper :

[DllImport("secur32.dll", CharSet=CharSet.Auto)]
public static extern int GetUserNameEx (int nameFormat,
StringBuilder userName, ref int userNameSize);

But is there no .Net code available ??

Greets
Glenn

.



Relevant Pages