Share via


IWMSDiagnosticEvents.Count (Visual Basic .NET)

banner art

Previous Next

IWMSDiagnosticEvents.Count (Visual Basic .NET)

The Count property retrieves the number of IWMSDiagnosticEvent objects contained in the IWMSDiagnosticEvents collection.

Syntax

  Integer = IWMSDiagnosticEvents.Count

Property Value

Integer containing the number of IWMSDiagnosticEvent objects.

Remarks

The collection can contain a maximum of 100 IWMSDiagnosticEvent objects. When this limit is reached, the oldest object in the collection is replaced by the newest. Each IWMSDiagnosticEvent object that describes a unique server or publishing point limit is included only once in the collection, but the time and date are updated to reflect the most recent occurrence. For more information, see IWMSDiagnosticEvent.Time and IWMSDiagnosticEvent.NumberOfOccurrences.

This property is read-only.

Example Code

Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices

Private Sub GetCount()

    ' Declare variables.
    Dim Server As WMSServer
    Dim DiagnosticEvents As IWMSDiagnosticEvents
    Dim iCount As Integer

Try
    ' Create the WMSServer object.
    Server = New WMSServer()

    ' Retrieve the IWMSDiagnosticEvents object.
    DiagnosticEvents = Server.DiagnosticEvents

    ' Retrieve the total count of events.
    iCount = DiagnosticEvents.Count

Catch excCom As COMException
    ' TODO: Handle COM exceptions.
Catch exc As Exception
    ' TODO: Handle errors.
Finally
    ' TODO: Clean-up code goes here.
End Try

End Sub

Requirements

Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also

Previous Next