SPSecurity.RunWithElevatedPrivileges(delegate() {

using(SPSite site =new SPSite(SPContext.Current.Site.ID)) {

  ServerContext serverContext = ServerContext.GetContext(site);

   UserProfileManager userProfileManager =

      new UserProfileManager(serverContext);

   userProfile = userProfileManager.GetUserProfile(userName);

 }

});

Yorum ekle


Güvenlik kodu
Yenile