如果可以使用MOSS列表网络服务检索上次修改文档的人的用户ID,请告诉我们吗?如果是,请告诉我列名称。
答案 0 :(得分:0)
每个项目都有Modified
属性以及Modified By
字段,分别以Modified
和Editor
作为其内部字段名称。是的,您可以查看最后修改文档的人以及修改完成的时间。
ViewFields的CAML将是
<ViewFields>
<FieldRef Name='Modified' />
<FieldRef Name='Editor' />
</ViewFields>
因此,将此放在GetListItems文档页面上的MSDN示例中将成为:
SrvRef.Lists listService = new Web_Reference_Folder.Lists();
listService.Credentials= System.Net.CredentialCache.DefaultCredentials;
XmlDocument xmlDoc = new System.Xml.XmlDocument();
XmlNode ndViewFields = xmlDoc.CreateNode(XmlNodeType.Element,"ViewFields","");
ndViewFields.InnerXml = "<FieldRef Name='Modified' /><FieldRef Name='Editor' />";
// maybe add a Where clause as well to retrieve specific items only
// XmlNode ndQuery = xmlDoc.CreateNode(XmlNodeType.Element,"Query","");
// ndQuery.InnerXml = "<Where><ADD PREDICATES HERE</Where>";
try
{
XmlNode ndListItems = listService.GetListItems("LISTNAME", null, null, ndViewFields, null, null, null);
// do something with the result
}
catch (System.Web.Services.Protocols.SoapException ex)
{
MessageBox.Show("Message:\n" + ex.Message + "\nDetail:\n" + ex.Detail.InnerText + "\nStackTrace:\n" + ex.StackTrace);
}