사용자 정보 목록과 연락처 목록을 만듭니다
-
28-09-2020 - |
문제
사용자 정보 목록과 SharePoint 2013 기반의 목록을 채우고 싶습니다.사용자 정보 목록은 /_catalogs/user/simple.aspx (siteuserinfolist)에서 발견되며 사용자의 모든 항목이 포함됩니다.
이 작업을 수행하는 방법에 대한 아이디어는 무엇입니까?
다른 팁
The url provided is basically a oob list that contains all the user information. That means you can fetch an instance of it and perform normal list operations with it.
If using server object model, this is the code I lifted from Code Project and modified.
SPUser sUser = myweb.CurrentUser;
SPList UserList = SPContext.Current.Web.SiteUserInfoList;
SPList targetList = SPContext.Current.Web.Lists["target"];
foreach(SPListItem item in UserList.Items.GetItems())
{
var newItem = targetList.Items.Add();
newItem["UserName"] = item.Name;
//populate column values;
newItem.Update();
}
If you want to use different object model then there is comphrensive guide to working with list and list items using different object models : Here
제휴하지 않습니다 sharepoint.stackexchange