EventKeywords 枚举


定义应用于事件的标准关键字。Defines the standard keywords that apply to events.

此枚举有一个 {0} 属性,允许按位组合成员值。

public enum class EventKeywords
public enum EventKeywords
type EventKeywords = 
Public Enum EventKeywords


All -1

所有位设为 1,表示每个可能的事件组。All the bits are set to 1, representing every possible group of events.

AuditFailure 4503599627370496

已附加到所有失败的安全审核事件。Attached to all failed security audit events. 仅对安全日志中的事件使用此关键字。Use this keyword only for events in the security log.

AuditSuccess 9007199254740992

已附加到所有成功的安全审核事件。Attached to all successful security audit events. 仅对安全日志中的事件使用此关键字。Use this keyword only for events in the security log.

CorrelationHint 4503599627370496

已附加到传输事件,其中相关的活动 ID(相关 ID)是一个计算值,不能保证其唯一性(即它不是真正的 GUID)。Attached to transfer events where the related activity ID (correlation ID) is a computed value and is not guaranteed to be unique (that is, it is not a real GUID).

EventLogClassic 36028797018963968

附加到使用 RaiseEvent 函数引发的事件。Attached to events that are raised by using the RaiseEvent function.

MicrosoftTelemetry 562949953421312

已附加到所有 Microsoft 遥测事件。Attached to all Microsoft telemetry events.

None 0

发布此事件时未对关键字执行任何筛选。No filtering on keywords is performed when the event is published.

Sqm 2251799813685248

已附加到所有服务质量机制 (SQM) 事件。Attached to all Service Quality Mechanism (SQM) events.

WdiContext 562949953421312

已附加到所有 Windows 诊断基础结构 (WDI) 上下文事件。Attached to all Windows Diagnostics Infrastructure (WDI) context events.

WdiDiagnostic 1125899906842624

已附加到所有 Windows 诊断基础结构 (WDI) 诊断事件。Attached to all Windows Diagnostics Infrastructure (WDI) diagnostic events.


下面的示例演示如何使用 EventKeywords 类重新定义事件关键字。The following example shows how to use the EventKeywords class to redefine event keywords. 此代码示例是为 EventSource 类提供的更大示例的一部分。This code example is part of a larger example provided for the EventSource class.

public 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


可以通过为标志分配不同的名称来自定义关键字的含义。You can customize the meaning of a keyword by assigning different names to the flags.