Export (0) Print
Expand All

SPAuditQuery constructor

Initializes a new instance of the SPAuditQuery class.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public SPAuditQuery(
	SPSite site
)

Parameters

site
Type: Microsoft.SharePoint.SPSite

An SPSite object that identifies the outermost scope of the query.

The following example (from Item-Level Auditing with SharePoint Server 2007) shows this constructor in use.

SPAuditQuery wssQuery = new SPAuditQuery(siteCollection);
wssQuery.RestrictToListItem(item);
SPAuditEntryCollection auditCol = site.Audit.GetEntries(wssQuery);

foreach (SPAuditEntry entry in auditCol) {
  // get info from audit log
}
Show:
© 2014 Microsoft