📄 ntlog.frm
字号:
VERSION 5.00
Object = "{75D4F148-8785-11D3-93AD-0000832EF44D}#3.2#0"; "FAST2003.ocx"
Begin VB.Form frmNTLog
BorderStyle = 3 'Fixed Dialog
Caption = "NT Log Manager"
ClientHeight = 3840
ClientLeft = 3825
ClientTop = 2865
ClientWidth = 7620
Icon = "NTLog.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3840
ScaleWidth = 7620
ShowInTaskbar = 0 'False
Begin FLWSystem.FWNTLog objNTLog
Left = 6480
Top = 1110
_ExtentX = 820
_ExtentY = 820
End
Begin VB.CommandButton cmdWrite
Caption = "Write demo event"
Height = 525
Left = 6300
Style = 1 'Graphical
TabIndex = 16
Top = 270
Width = 1155
End
Begin VB.VScrollBar scrCount
Height = 1725
Left = 2070
TabIndex = 13
Top = 240
Width = 255
End
Begin VB.TextBox txtText
BackColor = &H8000000F&
Height = 1695
Left = 90
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 12
Top = 2040
Width = 7455
End
Begin VB.Frame fraFrame
Caption = "Event Type"
Height = 1305
Left = 90
TabIndex = 2
Top = 660
Width = 1815
Begin VB.OptionButton optEvent
Caption = "System"
Height = 228
Index = 0
Left = 180
TabIndex = 5
Top = 330
Width = 1560
End
Begin VB.OptionButton optEvent
Caption = "Security"
Height = 228
Index = 1
Left = 180
TabIndex = 4
Top = 615
Width = 1560
End
Begin VB.OptionButton optEvent
Caption = "Application"
Height = 228
Index = 2
Left = 180
TabIndex = 3
Top = 915
Width = 1560
End
End
Begin VB.TextBox txtServer
Height = 288
Left = 90
TabIndex = 0
Top = 300
Width = 1668
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "Label1"
BeginProperty Font
Name = "Courier New"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Index = 7
Left = 2430
TabIndex = 15
Top = 1770
Width = 630
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "Label1"
BeginProperty Font
Name = "Courier New"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Index = 6
Left = 2430
TabIndex = 14
Top = 1542
Width = 630
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "Label1"
BeginProperty Font
Name = "Courier New"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Index = 5
Left = 2430
TabIndex = 11
Top = 1320
Width = 630
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "Label1"
BeginProperty Font
Name = "Courier New"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Index = 4
Left = 2430
TabIndex = 10
Top = 1098
Width = 630
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "Label1"
BeginProperty Font
Name = "Courier New"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Index = 3
Left = 2430
TabIndex = 9
Top = 876
Width = 630
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "Label1"
BeginProperty Font
Name = "Courier New"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Index = 2
Left = 2430
TabIndex = 8
Top = 654
Width = 630
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "Label1"
BeginProperty Font
Name = "Courier New"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Index = 1
Left = 2430
TabIndex = 7
Top = 432
Width = 630
End
Begin VB.Label lblLabel
AutoSize = -1 'True
Caption = "Label1"
BeginProperty Font
Name = "Courier New"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Index = 0
Left = 2430
TabIndex = 6
Top = 210
Width = 630
End
Begin VB.Label lblMachine
Caption = "Server Name"
Height = 195
Left = 90
TabIndex = 1
Top = 90
Width = 1020
End
End
Attribute VB_Name = "frmNTLog"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdWrite_Click()
Call objNTLog.Report("Event source", ":-) This's an event...", flwEventInfo, 1, 12)
End Sub
Private Sub Form_Load()
optEvent(2).Value = True
End Sub
Private Sub scrCount_Change()
objNTLog.EventNumber = scrCount.Value
End Sub
Private Sub scrCount_Scroll()
objNTLog.EventNumber = scrCount.Value
End Sub
Private Sub optEvent_Click(Index As Integer)
Select Case Index
Case 0
objNTLog.EventLog = flwEventSystem
Case 1
objNTLog.EventLog = flwEventSecurity
Case 2
objNTLog.EventLog = flwEventApp
End Select
scrCount.Enabled = objNTLog.Count > 0
scrCount.Min = 1
scrCount.Max = objNTLog.Count
scrCount.Value = objNTLog.Count
End Sub
Private Sub objNTLog_Change()
Dim strType As String
lblLabel(0) = "Event number " & objNTLog.EventNumber & "/" & objNTLog.Count
lblLabel(1) = "Generated on " & objNTLog.TimeGenerated
lblLabel(2) = "Written on " & objNTLog.TimeWritten
lblLabel(3) = "Machine " & objNTLog.ComputerName
lblLabel(4) = "Category " & objNTLog.EventCategory
lblLabel(5) = "Event ID " & objNTLog.EventID
Select Case objNTLog.EventType
Case flwEventError
strType = "Error"
Case flwEventWarning
strType = "Warning"
Case flwEventInfo
strType = "Info"
Case flwEventAuditSuccess
strType = "Audit success"
Case flwEventAuditFailure
strType = "Audit failure"
End Select
lblLabel(6) = "Event type " & strType
lblLabel(7) = "Event source " & objNTLog.SourceName
txtText = objNTLog.Text
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -