共用方式為


SPAuditQuery class

定義查詢的 SharePoint 資料庫的稽核項目。

Inheritance hierarchy

System.Object
  Microsoft.SharePoint.SPAuditQuery

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

Syntax

'宣告
Public NotInheritable Class SPAuditQuery
'用途
Dim instance As SPAuditQuery
public sealed class SPAuditQuery

備註

任何查詢基本範圍永遠都會是網站集合。但是,您可以使用類別的成員,來限制查詢特定的日期範圍、 使用者、 事件型別、 清單和清單項目。

這個類別主要用作為GetEntries(SPAuditQuery)方法的參數。

若要查詢的稽核事件的記錄以外的 SharePoint 資料庫,您無法使用這個類別。

Examples

下列範例 ( Item-Level Auditing with SharePoint Server 2007) 顯示這個類別使用中。

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

foreach (SPAuditEntry entry in auditCol) {
  // get info from audit log
}
Dim wssQuery As New SPAuditQuery(siteCollection)
wssQuery.RestrictToListItem(item)
Dim auditCol As SPAuditEntryCollection = site.Audit.GetEntries(wssQuery)

For Each entry As SPAuditEntry In auditCol
  ' get info from audit log
Next entry

Thread safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

請參閱

參照

SPAuditQuery members

Microsoft.SharePoint namespace

其他資源

Item-Level Auditing with SharePoint Server 2007