using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
using Microsoft.Office.Server.UserProfiles;
using Microsoft.Office.Server;
SPSite _site = new SPSite("http://server/");
ServerContext scontext = ServerContext.GetContext(_site);
SPUser memb = _site.OpenWeb().CurrentUser;
UserProfileManager upm = new UserProfileManager(scontext);
UserProfile up = upm.GetUserProfile(memb.LoginName);
MessageBox.Show(up["FirstName"].ToString() + up["LastName"].ToString());
Hope this will help.
we can get from Active directory also.
In this we are accessing only sharepoint user profile store
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment