Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SPSecurity.RunWithElevatedPrivileges(delegate()
- {
- string siteUrl = SPContext.Current.Web.Url;
- using (SPSite siteCollection = new SPSite(siteUrl))
- {
- SPServiceContext serviceContext = SPServiceContext.GetContext(siteCollection);
- UserProfileManager userProfileMgr = new UserProfileManager(serviceContext);
- UserProfile userProfile = userProfileMgr.GetUserProfile(true);
- try
- {
- userProfile["SkypeAccount"].Value = "test";
- userProfile.Commit();
- }
- catch { }
- try
- {
- userProfile["WorkPhone"].Value = "12345678";
- userProfile.Commit();
- }
- catch { }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement