IWMSAdminNetworkDataSourcePlugin.SetProxyCredentials (C#)

The SetProxyCredentials method specifies the user name and password used for authentication on the proxy server.

IWMSAdminNetworkDataSourcePlugin.SetProxyCredentials(bstrProtocol, 
                                   bstrName, bstrPassword, fPersist);

Arguments

bstrProtocol

[in] string containing the protocol. This must be either HTTP or RTSP.

bstrName

[in] string containing the user name used for authentication on the proxy server.

bstrPassword

[in] string containing the password used for authentication on the proxy server.

fPersist

[in] bool indicating whether the proxy credentials should be saved.

Return Value

This method does not return a value.

If this method fails, it throws an exception.

Number

Description

0xC00D002B

The bstrProtocol parameter must be HTTP or RTSP.

Remarks

Before returning, this method zeros out the memory used internally for the user name and password so that unencrypted local copies cannot be found on the computer on which Windows Media Services is running.

Example

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

// Declare variables.
WMSServer Server;
IWMSPlugin Plugin;
IWMSAdminNetworkDataSourcePlugin AdminNetDataSrc;

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

    // Retrieve the plug-in to be configured.
    Plugin = Server.DataSources[
                      "WMS Network Data Source"];

    // Retrieve the custom interface of the plug-in.
    AdminNetDataSrc =
    (IWMSAdminNetworkDataSourcePlugin)Plugin.CustomInterface;

    // Set the user name and password used to respond
    // to authentication challenges.
    AdminNetDataSrc.SetProxyCredentials("RTSP", "UserName",
                                        "Password", true);
}
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

Reference

IWMSAdminNetworkDataSourcePlugin Object (C#)

IWMSAdminNetworkDataSourcePlugin.get_ProxyPassword (C#)

IWMSAdminNetworkDataSourcePlugin.get_ProxyUserName (C#)