你的分享就是我们的动力 ---﹥

Perl 写 Windows 事件日志

时间:2013-05-30 00:16来源:www.chengxuyuans.com 点击:

Perl 写 Windows 事件日志码片段

use Win32::EventLog;

$eventLog = Win32::EventLog->new('System') || die $!;
%eventRecord = (
      'Source'       => 0,
      'Computer'     => 0,
      'Length'       => 0,
      'RecordNumber' => 0,
      'TimeGenerated'=> 0,
      'Timewritten'  => 0,
      'ClosingRecordNumber' => 0,
      'Category'     => 2,
      'EventID'      => 4242,
      'EventType'    => EVENTLOG_INFORMATION_TYPE,
      'Strings'      => "Used to identify the data",
      'Data'         => "Informational data about the message",
      );
$eventLog->Report(\%eventRecord);

转载注明地址:http://www.chengxuyuans.com/Perl/63102.html