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
When getting the value, this property returns an Integer containing the cumulative number of advertisements that have been streamed.
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.
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
Reference: Add a reference to Microsoft.WindowsMediaServices.
Platform: Windows Server 2003 family, Windows Server 2008 family.