IWMSPublishingPoint.DistributionUserName (C#)

banner art

Previous Next

IWMSPublishingPoint.DistributionUserName (C#)

The DistributionUserName property retrieves the user name provided by the client in response to an authentication challenge sent during server-to-server distribution.

Syntax

  IWMSPublishingPoint
  .DistributionUserName = string;
string = IWMSPublishingPoint.DistributionUserName;

Property Value

A string containing the user name.

If this property fails, it throws an exception.

Number Description
0x8007000E There is insufficient memory to complete the function.
0xC00D145AL The publishing point was already removed.

Remarks

You can use a password and the name returned by the DistributionUserName property to retrieve content from a publishing point on a remote server that has authentication and authorization plug-ins enabled.

Example Code

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

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

bool                   bVal;
string                 strText;

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

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

    // Retrieve information about each publishing point.
    for (int i = 0; i < PubPoints.Count; i++)
    {
        PubPoint = PubPoints[i];

        // Retrieve a Boolean value indicating whether
        // a distribution password is set.
        bVal = PubPoint.IsDistributionPasswordSet;

        // Retrieve the distribution user name associated
        // with the publishing point.
        strText = PubPoint.DistributionUserName;

    }
}
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