Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Wednesday, November 3, 2010

How to Get Current User Name

All the developers might have coded atleast once for finding the current context User


Windows Application

WindowsIdentity.GetCurrent().Name


Environment.UserName

System.Windows.Forms.SystemInformation.UserName

Web Application

HttpContext.Current.User
WindowsIdentity.GetCurrent().Name

SharePoint

SPContext.Current.User