本帖最后由 redapple2008 于 2018-9-13 09:56 编辑
这个是加载dll写系统日志的,我自定议log文件需要自己写文件生成吗?
#include "_CustomEventLog.au3"
$MyEventName = "AutoIt"
$EventLog = _SetLog($MyEventName,"AutoIteventmsg.dll")
If NOT @error then
_RegisterEvent($EventLog, $SUCCESS, $App_Started, @ScriptName)
_RegisterEvent($EventLog, $INFORMATION, $App_OK, "Just confirming this app is OK")
_RegisterEvent($EventLog, $ERROR, $App_Error, "This app is not feeling very well" & @crlf & "Can someone call a doctor")
_RegisterEvent($EventLog, $WARNING, $App_Warning, "There is no crap in this event log")
_RegisterEvent($EventLog, $INFORMATION, $App_Information, "Nothing to see here")
_RegisterEvent($EventLog, $INFORMATION, $App_Free, "This is my Free string" & @crlf & "with nothing at the begining")
_RegisterEvent($EventLog, $SUCCESS, $App_Stopped, @ScriptName)
EndIf
;or using the normal AutoIt includes
$EventLog = _SetLog($MyEventName,"AutoIteventmsg.dll")
Global $aData[1]=[0]
$hEventLog = _EventLog__RegisterSource("",$EventLog)
_EventLog__Report($hEventLog, $INFORMATION, "None", $App_Information, "","Another message without the crap", $aData)
_EventLog__Close ($hEventLog)
|