sharepoint 中根据loginName获取displayName以及用户信息 .

//获取当前站点

SPServiceContext spservercontent = SPServiceContext.GetContext(site);

//获取UserProfileManager实例

 UserProfileManager upMan = new UserProfileManager(spservercontent);

使用GetUserProfile方法获取displayName

 userprofile = upMan.GetUserProfile(LoginName.ToString());

 

string displayName = userprofile.DisplayName;

posted @ 2013-02-25 01:05  Star★  阅读(218)  评论(0编辑  收藏  举报