IWMSIPEntry.Mask (Visual Basic .NET)
Previous | Next |
IWMSIPEntry.Mask (Visual Basic .NET)
The Mask property specifies and retrieves an IP address mask.
Syntax
IWMSIPEntry .Mask = String String = IWMSIPEntry.Mask
Property Value
A String value containing the returned IP mask.
If this property fails, it throws an exception.
Number | Description |
0x80004005 | The server cannot find an IP address entry list. |
0x8007000E | The server could not allocate memory. |
Remarks
When the address, which is specified by the IWMSIPEntry.Address property, refers to a valid IPv6 address the mask must be set to a single numeric value representing the IPv6 prefix length. For example, if the IP address is 3FFE:5000::1, the mask might be set to 127. When the address refers to a valid IPv4 address the mask must be set using decimal notation. The server treats the mask as a 32-bit value. Each bit in the mask is compared to the corresponding bit in the IP address. When the bit value in the mask is 1, the corresponding bit in the IP address is included in the list. When the bit value in the mask is 0, any value is included. For example if the IP address in the list is 134.123.123.20 and the mask is 255.255.255.0 (that is, the bit fields are 11111111 11111111 11111111 00000000), all IP addresses from 134.123.123.0 to 134.123.123.255 are included in the list.
Example Code
Imports Microsoft.WindowsMediaServices.Interop Imports System.Runtime.InteropServices Private Sub GetMask() ' Declare variables. Dim Server As WMSServer Dim Plugin As IWMSPlugin Dim IPAdmin As IWMSIPAdmin Dim IPList As IWMSIPList Dim IPEntry As IWMSIPEntry Dim strMask As String Try ' Create the WMSServer object. Server = New WMSServer() ' Retrieve the plug-in to be configured. Plugin = Server.EventHandlers.Item("WMS IP Address Authorization") ' Retrieve the custom interface of the plug-in. IPAdmin = Plugin.CustomInterface ' Retrieve the list of banned IP addresses. IPList = IPAdmin.DisallowIP ' Retrieve the information associated ' with each banned address. For Each IPEntry In IPList strMask = IPEntry.Mask Next Catch excCom As COMException ' TODO: Handle COM exceptions. Catch exc As Exception ' TODO: Handle errors. Finally ' TODO: Clean-up code goes here. End Try End Sub
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 |