Share via


IWMSAdminNetworkDataSourcePlugin.get_SupportedProtocolName (C#)

banner art

Previous Next

IWMSAdminNetworkDataSourcePlugin.get_SupportedProtocolName (C#)

The get_SupportedProtocolName method retrieves the name of a specific protocol from a list of supported protocols.

Syntax

  string = AdminNetworkDataSourcePlugin.get_SupportedProtocolName(dwProtocolNum);

Parameters

dwProtocolNum

[in] int containing the index.

Return Values

This method returns a string containing the protocol name.

If this method fails, it throws an exception.

Number Description
0x80070057 The dwProtocolNum parameter is 0 or 1, but neither the HTTP protocol nor the RTSP protocol are supported, or the dwProtocolNum parameter is not 0 or 1.

Remarks

If you specify 0 for the dwProtocolNum parameter, the server returns HTTP if it is supported. If you specify 0 for the dwProtocolNum parameter, and HTTP is not supported but RTSP is, the server returns RTSP. If you specify 1 for the dwProtocolNum parameter, and RTSP is supported, the server returns RTSP. The server does not return HTTP if you specify 1 for the dwProtocolNum parameter.

Example Code

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;

    // Retrieve the name of the first supported protocol.
    string strProtocol = AdminNetDataSrc.get_SupportedProtocolName(0);
}
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