Software Development Network>> Visual C#>> retrieve user name
The short answer is:
System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString()Have a look at this thread for details - it's on the same topic:
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=340739&SiteID=1
retrieve user name
kefka95
MessageBox.Show( "Username: " + Environment.UserName );
phikappa
The short answer is:
System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString()
Have a look at this thread for details - it's on the same topic:
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=340739&SiteID=1