SP.ClientContext SPContext = new SP.ClientContext(@"http://xxxxx/");
SP.List SPlist = SPContext.Web.Lists.GetByTitle("xxxxxxx");
SPContext.Load(SPlist);
SPContext.ExecuteQuery();
SP.CamlQuery SPCaml = new SP.CamlQuery();
SP.ListItemCollection SPListItems = SPlist.GetItems(SPCaml);
SPContext.Load(SPlist);
SPContext.Load(SPListItems);
SPContext.ExecuteQuery();
foreach (SP.ListItem ListItems in SPListItems)
{
Console.Write(ListItems["creatorTxt"] + "\t");
Console.WriteLine(ListItems["Author"].ToString());
break;
}
我这样只能显示Microsoft.SharePoint.Client.FielUserValue
我要取得用户的名字。请高手指点啊
SharePoint
------解决方案--------------------
SPListItem getitme = SPContext.Current.ListItem;
//给列表的灰色的字体赋值。
string getAuthor = getitme["Author"].ToString(); //创建人
LabelCreatUser.Text = getAuthor.Split('#')[1]; //创建人姓名,
LabelCreatDate.Text = getitme["Created"].ToString();// 创建时间
------解决方案--------------------