IWMSBroadcastPublishingPoint.UpTime (C#)

banner art

Previous Next

IWMSBroadcastPublishingPoint.UpTime (C#)

The UpTime property retrieves the elapsed time, in seconds, that the publishing point has been running.

Syntax

  int = IWMSBroadcastPublishingPoint.UpTime;

Property Value

int containing the elapsed time, in seconds, that the publishing point has been running.

If this property fails, it throws an exception.

Number Description
0xC00D145AL The publishing point has already been removed.

Remarks

This property is read-only. When the StartWithoutData method is used to start a publishing point, this property is not updated. If the publishing point is not started, zero is returned.

Example Code

using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;

// Declare variables.
WMSServer                       Server;
IWMSBroadcastPublishingPoint    BCPubPoint;
IWMSPublishingPoints            PubPoints;
IWMSPublishingPoint             PubPoint;

int                            iCount;

try {
    // Create a new WMSServer object.
    Server = new WMSServerClass();

    // Retrieve the IWMSPublishingPoints object.
    PubPoints = Server.PublishingPoints;

    // Retrieve each publishing point and retrieve the
    // IWMSBroadcastPublishingPoint object.
    for (int i = 0; i < PubPoints.Count; i++)
    {
        PubPoint = PubPoints[i];

        if (PubPoint.Type == 
            WMS_PUBLISHING_POINT_TYPE.WMS_PUBLISHING_POINT_TYPE_BROADCAST)
        {
            BCPubPoint = (IWMSBroadcastPublishingPoint)PubPoint;

            // Retrieve the up-time statistic for the publishing point.
            iCount = BCPubPoint.UpTime;
            break;
        }
    }
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch (Exception e) {
    // TODO: Handle exceptions.
}

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