sharepoint user field

SPFieldUser userField = (SPFieldUser)site.Lists["Gifts"].Fields.GetField(“Recipient Name”);
SPFieldUserValue fieldValue = (SPFieldUserValue)userField.GetFieldValue(item["Recipient Name"].ToString());

string username = fieldValue.LookupValue;
strint uid = filedValue.LookupId;
SPUser user = fieldValue.User;

===========================================================================================================

SPFieldUser UsersColumn = (SPFieldUser)currentItem.Fields.GetField(“Users”);
SPFieldUserValueCollection Users = (SPFieldUserValueCollection)UsersColumn.GetFieldValue(currentItem["Users"].ToString());

你可能感兴趣的:(SharePoint)