Get current user name from system

  • Thread starter Thread starter Homauoon
  • Start date Start date
H

Homauoon

Dear sir
I want to get current user name from system
(in windows applications) by using WNetGetUser
function from Mpr.lib.
Please help me.
Thanks
 
To get the current user, better switch to .NET:
Environment.UserName
or
System.Windows.Forms.SystemInformation.UserName
 
Hi,

You can use :
WindowsIdentity.GetCurrent().Name



It return the user logged on the system.

Hope this help,
 
Back
Top