Hi guys,
Recently I was creating a Web Part and I needed to get hold of the current login name for comparison. It was simple and didn’t require great amounts of code. Thanks you
SharePoint for making life easier.
string userName = SPContext.Current.Web.CurrentUser.LoginName;
Returns
domain\LoginName