使用托管c ++写入Windows事件日志 [英] Using managed c++ for writing to windows event log
问题描述
我正在编写一个小型的c应用程序,并希望使用托管c ++登录到Windows事件日志。
I am writing a small c application and will like to log to the windows event log using managed c++.
您会建议这种方法吗?如果不是,为什么不呢?
Will you advice this approach? If no, why not?
有人可以详细说明如何使用非托管c ++进行日志记录。
Could someone elaborate how to go about logging with unmanaged c++.
推荐答案
您好,
谢谢在这里发布。
.NET Framework提供与windows事件日志的交互,它是
EventLog类。
The .NET Framework provides interaction with windows event logs, it is EventLog Class.
EventLog允许您访问或自定义Windows事件日志,记录有关重要软件或硬件事件的信息。使用 EventLog,您可以从现有日志中读取,将条目写入日志,创建或删除事件源,删除日志,以及
响应日志条目。你也可以 创建 新 创建事件源时记录。
EventLog lets you access or customize Windows event logs, which record information about important software or hardware events. Using EventLog, you can read from existing logs, write entries to logs, create or delete event sources, delete logs, and respond to log entries. You can also create new logs when creating an event source.
这是一个关于如何
在VC中记录事件,您可以使用该方法记录本机c ++的事件。
Here is a demo about how Logging Events in VC, you could use the method to log event for native c++.
最好的问候,
Hart
这篇关于使用托管c ++写入Windows事件日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!