EventKeywords 枚举
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
定义应用于事件的标准关键字。
此枚举支持其成员值的按位组合。
public enum class EventKeywords
[System.Flags]
public enum EventKeywords
[<System.Flags>]
type EventKeywords =
Public Enum EventKeywords
- 继承
- 属性
字段
| 名称 | 值 | 说明 |
|---|---|---|
| All | -1 | 所有位都设置为 1,表示每个可能的事件组。 |
| None | 0 | 发布事件时不对关键字执行筛选。 |
| MicrosoftTelemetry | 562949953421312 | 附加到所有Microsoft遥测事件。 |
| WdiContext | 562949953421312 | 附加到所有Windows诊断基础结构(WDI)上下文事件。 |
| WdiDiagnostic | 1125899906842624 | 附加到所有Windows诊断基础结构(WDI)诊断事件。 |
| Sqm | 2251799813685248 | 附加到所有服务质量机制(SQM)事件。 |
| AuditFailure | 4503599627370496 | 附加到所有失败的安全审核事件。 将此关键字仅用于安全日志中的事件。 |
| CorrelationHint | 4503599627370496 | 附加到传输事件,其中相关活动 ID(相关 ID)是一个计算值,不保证是唯一的(即,它不是真正的 GUID)。 |
| AuditSuccess | 9007199254740992 | 附加到所有成功的安全审核事件。 将此关键字仅用于安全日志中的事件。 |
| EventLogClassic | 36028797018963968 | 附加到使用 |
示例
以下示例演示如何使用 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
注解
可以通过向标志分配不同的名称来自定义关键字的含义。