Count Property
Collapse the table of content
Expand the table of content

EventLogEntryCollection.Count Property

 

Gets the number of entries in the event log (that is, the number of elements in the EventLogEntry collection).

Namespace:   System.Diagnostics
Assembly:  System (in System.dll)

abstract Count : int with get
override Count : int with get

Property Value

Type: System.Int32

The number of entries currently in the event log.

An EventLogEntryCollection represents a dynamic list of all the entries in a log. Therefore, the Count property can change during the lifetime of the EventLogEntryCollection instance that you create. It is usually best to work with the Count property directly instead of assigning its value to a variable.

The following example demonstrates how to use the Count property to iterate through an EventLogEntryCollection object.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show:
© 2016 Microsoft