是否可以从 Adob​​e AIR 中写入 Windows 事件日志?

发布于 2024-11-02 11:40:23 字数 220 浏览 0 评论 0原文

Adobe AIR(通过 AS3)是否可以将事件写入操作系统的事件日志?特别是,我需要一个事件显示在 Windows 7 事件查看器中。我尝试使用 throw 抛出自定义错误,但它没有出现在应用程序日志中。

我知道我可以创建一个 NativeProcess 来执行此操作,但我希望有一个本机 AIR 解决方案。

到目前为止,谷歌搜索毫无结果。

Is it possible for Adobe AIR (via AS3) to write events to the OS's event log? In particular, I need an event to show up in the the Windows 7 Event Viewer. I've tried using throw to throw a custom error, but it doesn't appear in the Application Logs.

I know I could create a NativeProcess to do this, but I'm hoping there's a native AIR solution.

Google searches have, thus far, been fruitless.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最后的乘客 2024-11-09 11:40:23

更新

虽然我最初的答案在技术上是正确的,但您需要了解一些知识,例如写入原始事件日志文件的数据格式。所以,这显然是一个问题。看来您最好的解决方案(尽管这不是您想要的解决方案)是编写一个快速可执行文件,您可以作为本机进程启动,该进程可以与执行此操作所需的 Windows C/CPP 库交互。这是一篇可以帮助您入门的文章:

http: //msdn.microsoft.com/en-us/library/dd996928(v=vs.85).aspx

AIR API 中不存在这样的东西的原因是目标AIR 的目标是成为一个跨平台 VM,(对于开发人员/用户)尽可能不了解其平台。这就是为什么您会发现最接近的平台集成本质上是文件 IO 和本机进程管理。

原始答案

只需找到系统上事件日志的位置,然后使用 AIR 文件 IO API 将原始数据附加到文件中即可。这里唯一可能的问题是用户权限,这些文件可能是只读的。

http://support.microsoft.com/kb/315417

Update

Although my original answer is technically right, you'd need to know several things like the data format for writing to the raw event log files. So, this is obviously a bit of an issue. It appears that your best solution, although it's not the solution you want, is to write a quick executable you can launch as a native process that can interface with the windows C/CPP libraries required to do this. Here is an article that should get you started:

http://msdn.microsoft.com/en-us/library/dd996928(v=vs.85).aspx

The reason why there would be no such thing existing within the AIR API is that the goal of AIR is to be a cross platform VM that is as agnostic (to the developer/user) about it's platform as possible. This is why the absolute closest platform integration you'll find is essentially file IO and native process management.

Original Answer

Just find the location of the event log(s) on the system and append the raw data to the file using the AIR file IO API's. The only possible issue here would be user permissions, these files may be read only.

http://support.microsoft.com/kb/315417

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文