SharePoint UserProfile User Information

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.