Sharepoint2013 Get current user UserfrofileBasic Introduction:
What makes a user configuration file. User properties and user profile properties provide information about SharePoint users, such as display names, e-mail messages, titles, and other business and personal information.
Developers can also change files and create files by getting the file. SHAREPOINT2013 is really a tool that can be developed through JavaScript object models. The Netclient object model, the service-period-end object model. This is solved with the server object model.
implementation:
Get Current User:
Stringloginname=system.web.httpcontext.current.user.identity.name.tostring ();
Get a lot of other information:
Spsecurity.runwithelevatedprivileges (Delegate{spsite _site = SPContext.Current.Site; Spservicecontext ServerContext = Spservicecontext.getcontext (_site); UserProfileManager myuserprofile = Newuserprofilemanager (servercontext); UserProfile currentuserprofile= Myuserprofile.getuserprofile (SPContext.Current.Web.CurrentUser.LoginName); string Departmentname = (String) currentuserprofile["department"]. value;//belongs to the Department string phonensumber= (String) currentuserprofile["Workphone"]. value;//Phone Number string emailaddress= (String) currentuserprofile["Workemail"]. value;//e-mail address})
Summary
So much is introduced, false assumptions many other understand, this is MSDV address:
http://msdn.microsoft.com/ZH-CN/library/office/jj163182 (v=office.15). aspx
Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.
SharePoint UserProfile User Information