home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form FrmDetails
- Caption = "Event details"
- ClientHeight = 5535
- ClientLeft = 4245
- ClientTop = 2970
- ClientWidth = 5865
- LinkTopic = "Form1"
- ScaleHeight = 5535
- ScaleWidth = 5865
- StartUpPosition = 2 'CenterScreen
- Begin VB.CommandButton cmdPrev
- Caption = "Previous"
- Height = 375
- Left = 2280
- TabIndex = 22
- Top = 5100
- Width = 1035
- End
- Begin VB.CommandButton btnNext
- Caption = "Next"
- Height = 375
- Left = 3540
- TabIndex = 21
- Top = 5100
- Width = 1035
- End
- Begin VB.CommandButton btnClose
- Caption = "Close"
- Default = -1 'True
- Height = 375
- Left = 4800
- TabIndex = 20
- Top = 5100
- Width = 1035
- End
- Begin VB.TextBox memData
- BackColor = &H80000004&
- Height = 1035
- Left = 0
- Locked = -1 'True
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 19
- Top = 3900
- Width = 5835
- End
- Begin VB.TextBox memDesription
- BackColor = &H80000004&
- Height = 1815
- Left = 0
- Locked = -1 'True
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 17
- Top = 1680
- Width = 5835
- End
- Begin VB.Label Label10
- Caption = "Data"
- Height = 195
- Left = 60
- TabIndex = 18
- Top = 3660
- Width = 1815
- End
- Begin VB.Label Label9
- Caption = "Description"
- Height = 195
- Left = 60
- TabIndex = 16
- Top = 1440
- Width = 1815
- End
- Begin VB.Label lblCategory
- Caption = "lblCategory"
- Height = 195
- Left = 4020
- TabIndex = 15
- Top = 1020
- Width = 1815
- End
- Begin VB.Label Label8
- Caption = "Category:"
- Height = 195
- Left = 2940
- TabIndex = 14
- Top = 1020
- Width = 795
- End
- Begin VB.Label lblType
- Caption = "lblType"
- Height = 195
- Left = 4020
- TabIndex = 13
- Top = 720
- Width = 1815
- End
- Begin VB.Label Label7
- Caption = "Type:"
- Height = 195
- Left = 2940
- TabIndex = 12
- Top = 720
- Width = 795
- End
- Begin VB.Label lblSource
- Caption = "lblSource"
- Height = 195
- Left = 4020
- TabIndex = 11
- Top = 420
- Width = 1815
- End
- Begin VB.Label Label6
- Caption = "Source:"
- Height = 195
- Left = 2940
- TabIndex = 10
- Top = 420
- Width = 795
- End
- Begin VB.Label lblEventID
- Caption = "lblEventID"
- Height = 195
- Left = 4020
- TabIndex = 9
- Top = 120
- Width = 1815
- End
- Begin VB.Label Label5
- Caption = "Event ID:"
- Height = 195
- Left = 2940
- TabIndex = 8
- Top = 120
- Width = 795
- End
- Begin VB.Label lblComputer
- Caption = "lblComputer"
- Height = 195
- Left = 960
- TabIndex = 7
- Top = 1020
- Width = 1815
- End
- Begin VB.Label Label4
- Caption = "Computer:"
- Height = 195
- Left = 60
- TabIndex = 6
- Top = 1020
- Width = 795
- End
- Begin VB.Label lblUser
- Caption = "lblUser"
- Height = 195
- Left = 960
- TabIndex = 5
- Top = 720
- Width = 1815
- End
- Begin VB.Label Label3
- Caption = "User:"
- Height = 195
- Left = 60
- TabIndex = 4
- Top = 720
- Width = 615
- End
- Begin VB.Label lblTime
- Caption = "lblTime"
- Height = 195
- Left = 960
- TabIndex = 3
- Top = 420
- Width = 1875
- End
- Begin VB.Label Label2
- Caption = "Time:"
- Height = 195
- Left = 60
- TabIndex = 2
- Top = 420
- Width = 615
- End
- Begin VB.Label lblDate
- Caption = "lblDate"
- Height = 195
- Left = 960
- TabIndex = 1
- Top = 120
- Width = 1815
- End
- Begin VB.Label Label1
- Caption = "Date:"
- Height = 195
- Left = 60
- TabIndex = 0
- Top = 120
- Width = 615
- End
- Attribute VB_Name = "FrmDetails"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub ReadEvent(AIndex As Integer)
- Set Obj = FrmLog.NTEventLogX.Objects(AIndex)
- lblDate.Caption = Format(Obj.TimeWritten, "dd-mmm-yyyy")
- lblTime.Caption = Format(Obj.TimeWritten, "hh:nn:ss")
- lblSource.Caption = Obj.SourceName
- lblCategory.Caption = Format(Obj.EventCategory, "0")
- If Obj.EventId < 0 Then J = 65536 - (Abs(Obj.EventId) Mod 65536) Else J = Obj.EventId Mod 65536
- lblEventID.Caption = Format(J, "00000")
- lblUser.Caption = Obj.UserName
- lblComputer.Caption = Obj.ComputerName
- If Obj.EventType = EVT_SUCCESS Then lblType.Caption = "Success"
- If Obj.EventType = EVT_ERROR Then lblType.Caption = "Error"
- If Obj.EventType = EVT_WARNING Then lblType.Caption = "Warning"
- If Obj.EventType = EVT_INFORMATION Then lblType.Caption = "Information"
- If Obj.EventType = EVT_AUDIT_SUCCESS Then lblType.Caption = "Audit success"
- If Obj.EventType = EVT_AUDIT_FAILURE Then lblType.Caption = "Audit Failure"
- memDesription.Text = FrmLog.NTEventLogX.Items(AIndex)
- memData.Text = ""
- Set DataBytes = Obj.DataBytes
- For i = 0 To DataBytes.Count - 1
- memData.Text = memData.Text + Format(Hex(DataBytes.Item(i)), "00 ")
- Next i
- End Sub
- Private Sub btnClose_Click()
- Unload FrmDetails
- End Sub
- Private Sub btnNext_Click()
- If FrmLog.lbxEvents.ListIndex < FrmLog.lbxEvents.ListCount Then
- FrmLog.lbxEvents.ListIndex = FrmLog.lbxEvents.ListIndex + 1
- Form_Load
- End If
- End Sub
- Private Sub cmdPrev_Click()
- If FrmLog.lbxEvents.ListIndex > 0 Then
- FrmLog.lbxEvents.ListIndex = FrmLog.lbxEvents.ListIndex - 1
- Form_Load
- End If
- End Sub
- Private Sub Form_Load()
- If FrmLog.mniOldest.Checked Then ReadEvent (FrmLog.lbxEvents.ListIndex)
- If FrmLog.mniNewest.Checked Then ReadEvent (FrmLog.NTEventLogX.Count - FrmLog.lbxEvents.ListIndex - 1)
- End Sub
-