Share via


IWMSPublishingPointTotalCounters.Advertisements (Visual Basic .NET)

banner art

Previous Next

IWMSPublishingPointTotalCounters.Advertisements (Visual Basic .NET)

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

Syntax

  Integer =
  
  PublishingPointTotalCounters
  .Advertisements

Property Value

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 accessed through the presentation context WMS_PRESENT_PLAYLIST_ENTRY_ROLE property.

Example Code

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

Private Sub GetAds()

    ' Declare variables.
    Dim Server As WMSServer
    Dim PubPoints As IWMSPublishingPoints
    Dim PubPoint As IWMSPublishingPoint
    Dim TotalCounters As IWMSPublishingPointTotalCounters
    Dim iValue As Integer

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

    ' Retrieve the IWMSPublishingPoints object.
    PubPoints = Server.PublishingPoints

    ' Retrieve information about each publishing point.
    For Each PubPoint In PubPoints

        ' Retrieve a list of total statistics
        ' for the publishing point.
        TotalCounters = PubPoint.TotalCounters

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

    Next










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