EventLog.Source 和 EventLog.Delete(logName):是“源”和“logName”指的是同一财产?
在阅读有关创建自定义事件日志的内容时,我遇到了一些令人困惑的事情。
创建自定义事件日志时,您需要设置的一个属性是 Source
,它显然是您想要为日志指定的任何名称。当写入和读取此自定义日志时,您将指定此“源”。
删除日志时,还需要提供一个字符串参数,这个参数称为logName
。这些看起来像是同一件事。
此 logName 和您最初指定的“Source”是同一属性吗?如果是这样,为什么它们的命名不同(即为什么删除方法的参数不直接称为“Source”)?如果不是,它们是什么,它们有什么关系?
In reading about creating custom event logs, I came across something that is somewhat confusing.
When creating a custom event log, one property you need to set is the Source
, which apparently is any name you want to give to the log. When writing and reading to this custom log, you will specify this "Source".
When deleting a log, you also need to provide a string parameter, but this one is called logName
. These seem like the same thing.
Is this logName and the "Source" you originally specified the same propery? If so, why are they named differently (i.e. why isn't the parameter for the delete method just called "Source")? If not, what are they, how are they related?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,他们不是。
Source
指定写入日志的“应用程序”或“源”。LogName
是要写入/读取/删除的实际日志名称。No they are not.
Source
specifies what "application" or "source" is writing to the log.LogName
is the actualy log name to write/read/delete.