public SPUser GetCurrentUser()
{
var context = SPContext.Current;
SPWeb web = context.Web;
return web.CurrentUser;
}
After you getting the SPUser object you can retrieve the login name,email,first name and last name of this user.
Showing posts with label Getting currently logged in user. Show all posts
Showing posts with label Getting currently logged in user. Show all posts
Monday, May 07, 2012
current user in sharepoint
Trimmed lines of code to get the currently logged in user details in SharePoint
Subscribe to:
Posts (Atom)