EventKeywords 枚举 
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
定义应用于事件的标准关键字。
此枚举支持其成员值的按位组合。
public enum class EventKeywords[System.Flags]
public enum EventKeywords[<System.Flags>]
type EventKeywords = Public Enum EventKeywords- 继承
- 属性
字段
| 名称 | 值 | 说明 | 
|---|---|---|
| All | -1 | 所有位设为 1,表示每个可能的事件组。 | 
| AuditFailure | 4503599627370496 | 已附加到所有失败的安全审核事件。 仅对安全日志中的事件使用此关键字。 | 
| AuditSuccess | 9007199254740992 | 已附加到所有成功的安全审核事件。 仅对安全日志中的事件使用此关键字。 | 
| CorrelationHint | 4503599627370496 | 已附加到传输事件,其中相关的活动 ID(相关 ID)是一个计算值,不能保证其唯一性(即它不是真正的 GUID)。 | 
| EventLogClassic | 36028797018963968 | 附加到使用  | 
| 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
注解
可以通过为标志分配不同的名称来自定义关键字 (keyword) 的含义。