_EventLog__OpenBackup
Opens a handle to a backup event log
#include <EventLog.au3>
_EventLog__OpenBackup($sServerName, $sFileName)
Параметры
$sServerName | The UNC name of the server on where the event log will be opened. If blank, the operation is performed on the local computer. |
$sFileName |
The name of the backup file |
Возвращаемое значение
Успех: | The handle to the backup event log |
Ошибка: | Возвращает 0 |
Примечания
If the backup filename specifies a remote server, $sServerName must be blankСм. также
_EventLog__Close, _EventLog__BackupПример
#include <GUIConstantsEx.au3>
#include <EventLog.au3>
Global $iMemo
_Main()
Func _Main()
Local $hEventLog, $hGUI
; Создаёт GUI
$hGUI = GUICreate("EventLog", 400, 300)
$iMemo = GUICtrlCreateEdit("", 2, 2, 396, 300, 0)
GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
GUISetState()
$hEventLog = _EventLog__Open("", "Application")
_EventLog__Backup($hEventLog, "C:\EventLog.bak")
_EventLog__Close($hEventLog)
$hEventLog = _EventLog__OpenBackup("", "C:\EventLog.bak")
MemoWrite("Log full ........: " & _EventLog__Full ($hEventLog))
MemoWrite("Log record count : " & _EventLog__Count ($hEventLog))
MemoWrite("Log oldest record: " & _EventLog__Oldest ($hEventLog))
_EventLog__Close ($hEventLog)
; Цикл выполняется, пока окно не будет закрыто
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>_Main
; Записывает строку в элемент для заметок
Func MemoWrite($sMessage)
GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite