EventKeywords 列舉

定義

定義套用至事件的標準關鍵字。

此列舉支援其成員值的位元組合。

public enum class EventKeywords
[System.Flags]
public enum EventKeywords
[<System.Flags>]
type EventKeywords = 
Public Enum EventKeywords
繼承
EventKeywords
屬性

欄位

All -1

所有位元已設定為 1,表示事件的每種可能群組。

AuditFailure 4503599627370496

已附加至所有失敗的安全性稽核事件。 使用這個僅適用於安全性記錄檔中的事件的關鍵字。

AuditSuccess 9007199254740992

已附加至所有成功的安全性稽核事件。 使用這個僅適用於安全性記錄檔中的事件的關鍵字。

CorrelationHint 4503599627370496

已附加至傳輸事件,其中相關活動 ID (相互關聯 ID) 是經過計算的值,而且不保證是唯一 (也就是說,不是真正的 GUID) 的值。

EventLogClassic 36028797018963968

已附加至使用 RaiseEvent 函式引發的事件。

MicrosoftTelemetry 562949953421312

已附加至所有 Microsoft 遙測事件。

None 0

發行事件時未執行關鍵字篩選。

Sqm 2251799813685248

已附加至所有服務品質機制 (SQM) 事件。

WdiContext 562949953421312

附加至所有 Windows 診斷基礎結構 (WDI) 內容事件。

WdiDiagnostic 1125899906842624

附加至所有 Windows 診斷基礎結構 (WDI) 診斷事件。

範例

下列範例示範如何使用 EventKeywords 類別來重新定義事件關鍵字。 此程式碼範例是針對 類別提供的較大範例的 EventSource 一部分。

public static class Keywords
{
    public const EventKeywords Page = (EventKeywords)1;
    public const EventKeywords DataBase = (EventKeywords)2;
    public const EventKeywords Diagnostic = (EventKeywords)4;
    public const EventKeywords Perf = (EventKeywords)8;
}
Public Class Keywords
    Public Const Page As EventKeywords = CType(1, EventKeywords)
    Public Const DataBase As EventKeywords = CType(2, EventKeywords)
    Public Const Diagnostic As EventKeywords = CType(4, EventKeywords)
    Public Const Perf As EventKeywords = CType(8, EventKeywords)
End Class

備註

您可以將不同的名稱指派給旗標,以自訂關鍵字的意義。

適用於