Private Sub WriteEvents()
' Setup the event source
Dim EventSource As New EventSource
EventSource.SourceName = "mysource"
' Report the event - no strings or binary data
EventSource.ReportInformation "my event"
' Report the event - one string
EventSource.ReportWarning "my event", "This is a single string"
' Report the event - multiple strings
EventSource.ReportError "my event", _
Array("This", "is", "an", "array", "of", "strings")
' Report the event - binary data
EventSource.ReportInformation "my event", , _
Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
' Report the event - strings and binary data
EventSource.ReportWarning "my event", _
Array("This", "is", "an", "array", "of", "strings"), _
Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
End Sub
|