IWMSServerTotalCounters.Advertisements (Visual Basic .NET)

The Advertisements property retrieves the cumulative number of advertisements that have been streamed from playlists since the last reset.

Integer = ServerTotalCounters.Advertisements

Property Value

When getting the value, this property returns an Integer containing the cumulative number of advertisements that have been streamed.

Remarks

This property is read-only. When the server starts streaming from a playlist in which the role attribute has been set to Advertisement, the counters should be updated. The value specified for the role attribute can be accesed through the presentation context WMS_PRESENT_PLAYLIST_ENTRY_ROLE property.

Example

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

Private Sub GetAds()

    ' Declare variables.
    Dim Server As WMSServer
    Dim TotalCounters As IWMSServerTotalCounters
    Dim iValue As Integer

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

    ' Retrieve a list of total statistics
    ' for the server.
    TotalCounters = Server.TotalCounters

    ' Retrieve the total number of advertisements
    ' that have streamed since the start time.
    iValue = TotalCounters.Advertisements

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

Reference

IWMSServerTotalCounters Object (Visual Basic .NET)