IWMSIPAdmin.AccessListOptions (C#)

banner art

Previous Next

IWMSIPAdmin.AccessListOptions (C#)

The AccessListOptions property specifies and retrieves an enumeration value indicating the default access permissions for unspecified IP addresses.

Syntax

  IWMSIPAdmin
  .AccessListOptions = WMS_IP_ACCESS_OPTIONS;
WMS_IP_ACCESS_OPTIONS = IWMSIPAdmin.AccessListOptions;

Property Value

When getting the value, this property returns a member of the WMS_IP_ACCESS_OPTIONS enumeration type indicating default access permissions for unspecified IP addresses. This must be one of the following values.

Value Description
WMS_IP_ACCESS_ALLOW_AND_DISALLOW Unspecified IP addresses are ignored.
WMS_IP_ACCESS_ALLOW_BY_DEFAULT Unspecified IP addresses are authorized by default.
WMS_IP_ACCESS_DISALLOW_BY_DEFAULT Unspecified IP addresses are rejected by default.

If this property fails, it throws an exception.

Number Description
0x80070057 The value you specified does not contain a member of the WMS_IP_ACCESS_OPTIONS enumeration type.

Example Code

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

// Declare variables.
WMSServer Server;
IWMSPlugin Plugin;
IWMSIPAdmin IPAdmin;

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;

    // Configure the plug-in to allow all IP addresses
    // except those specifically set to deny.
    IPAdmin.AccessListOptions = WMS_IP_ACCESS_OPTIONS.
                                WMS_IP_ACCESS_ALLOW_BY_DEFAULT;
}
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