博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
sharepoint 2013 userprofile 用户信息
阅读量:6991 次
发布时间:2019-06-27

本文共 1059 字,大约阅读时间需要 3 分钟。

Sharepoint2013获得当前用户userfrofile

基本介绍:

什么使用户配置文件。 用户属性和用户配置文件属性提供有关 SharePoint 用户的信息,如显示名称、电子邮件、标题以及其它业务和个人信息。

开发人员能够通过获得该文件,也能够改动文件、创建文件。Sharepoint2013确实是个开发好工具,能够通过javascript对象模型、.NETclient对象模型、服务期端对象模型。这里用server对象模型解决。

实现:

得到当前用户:

stringLoginName=System.Web.HttpContext.Current.User.Identity.Name.ToString();

得到很多其它信息:

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;//所属部门string phoneNsumber= (string)currentUserProfile["workphone"].Value;//电话号码string emailAddress= (string)currentUserProfile["workEmail"].Value;//电子邮箱地址})

总结

就介绍这么多了,假设想很多其它了解,这是msdv地址:

http://msdn.microsoft.com/ZH-CN/library/office/jj163182(v=office.15).aspx

版权声明:本文博客原创文章,博客,未经同意,不得转载。

你可能感兴趣的文章
Cesium 加载天地图
查看>>
Centos7中安装最新版maven3.5.0
查看>>
python学习之老男孩python全栈第九期_数据库day003 -- 作业
查看>>
深度优先遍历
查看>>
常用类型转换 一.常用int和string类型转换
查看>>
Ext Js简单Grid分页及选择器的使用
查看>>
slice 定义和用法
查看>>
分类游戏 结构体
查看>>
导出、恢复、上传镜像
查看>>
java第一个程序提示找不到符号-System.out.printIn
查看>>
LineageOS源码定制手机系统
查看>>
flask怎样获取authorization
查看>>
Python3 Selenium自动化web测试 ==> 第六节 WebDriver高级应用 -- 操作web页面的滚动条...
查看>>
HTMl5的sessionStorage和localStorage的一些区别
查看>>
Find Minimum in Rotated Sorted Array
查看>>
Android Studio模拟器的问题及解决办法
查看>>
实现Android ListView 自动加载更多内容
查看>>
高淇Struts2.0教程之视频笔记(6)
查看>>
python二进制读写文件
查看>>
sql server 高可用性技术总结
查看>>