C“asp.net在sharepoint联机列表中插入字段类型为”的记录;“个人或团体”;

C“asp.net在sharepoint联机列表中插入字段类型为”的记录;“个人或团体”;,asp.net,sharepoint-online,Asp.net,Sharepoint Online,我想使用C#asp.net将记录插入sharepoint在线列表。该列表包含两列标题,用户类型分别为“单行文本”、“个人或组”。对于列标题,我可以直接将值分配给ListItem。但是,对于列用户,我应该使用FieldUserValue类型分配。我想知道如何使用电子邮件地址或其他查找值从sharepoint网站获取FieldUserValue ClientContext ctx = new ClientContext(url); ctx.Credentials = new SharePointOn

我想使用C#asp.net将记录插入sharepoint在线列表。该列表包含两列标题,用户类型分别为“单行文本”、“个人或组”。对于列标题,我可以直接将值分配给ListItem。但是,对于列用户,我应该使用FieldUserValue类型分配。我想知道如何使用电子邮件地址或其他查找值从sharepoint网站获取FieldUserValue

ClientContext ctx = new ClientContext(url);
ctx.Credentials = new SharePointOnlineCredentials(username, Password);
Microsoft.SharePoint.Client.List list = ctx.Web.Lists.GetByTitle("List1");
Microsoft.SharePoint.Client.ListItem items = list.AddItem(new ListItemCreationInformation());
items["Title"] = InsertTitle.Text;
items["User"] = ??? (FieldUserValue); 
items.Update();
ctx.ExecuteQuery();