Partager via


IWMSIPList Object (C#)

The IWMSIPList object contains a collection of IWMSIPEntry objects used by the WMS IP Address Authorization plug-in to allow or disallow client connections based on IP addresses.

The IWMSIPList object exposes the following properties and methods.

Property

Description

Count

Retrieves the number of IWMSIPEntry objects in the IWMSIPList collection.

Item

Retrieves a specific IWMSIPEntry object from the IWMSIPList collection.

length

Retrieves the number of IWMSIPEntry objects in the IWMSIPList collection. This method is included for JScript compatibility.

Method

Description

Add

Adds an IWMSIPEntry object to the IWMSIPList collection.

Remove

Removes a specific IWMSIPEntry object from the IWMSIPList collection.

Example

The following example illustrates how to retrieve an IWMSIPList object.

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

// Declare variables.
WMSServer Server;
IWMSPlugin Plugin;
IWMSIPAdmin IPAdmin;
IWMSIPList IPList;
IWMSIPEntry IPEntry;

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

    // Retrieve the plug-in to be configured.
    Plugin = Server.EventHandlers[
                       "WMS IP Address Authorization"];

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

    // Retrieve the list of banned IP addresses.
    IPList = IPAdmin.DisallowIP;
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch (Exception e) {
    // TODO: Handle exceptions.
}

See Also

Concepts

System Plug-ins (C#)