Export (0) Print
Expand All

HttpListenerPrefixCollection.Remove Method

Note: This method is new in the .NET Framework version 2.0.

Removes the specified Uniform Resource Identifier (URI) from the list of prefixes handled by the HttpListener object.

Namespace: System.Net
Assembly: System (in system.dll)

'Declaration
Public Function Remove ( _
	uriPrefix As String _
) As Boolean
'Usage
Dim instance As HttpListenerPrefixCollection
Dim uriPrefix As String
Dim returnValue As Boolean

returnValue = instance.Remove(uriPrefix)
public final boolean Remove (
	String uriPrefix
)
public final function Remove (
	uriPrefix : String
) : boolean

Parameters

uriPrefix

A String that contains the URI prefix to remove.

Return Value

true if the uriPrefix was found in the HttpListenerPrefixCollection and removed; otherwise false.

Exception typeCondition

ArgumentNullException

uriPrefix is a null reference (Nothing in Visual Basic).

HttpListenerException

A Windows function call failed. To determine the cause of the exception, check the exception's error code.

ObjectDisposedException

The HttpListener associated with this collection is closed.

If uriPrefix is not in the collection, this method does nothing.

Notes to Callers This member outputs trace information when you enable network tracing in your application. For more information, see Network Tracing.

The following code example removes a user-specified prefix from a HttpListenerPrefixCollection.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft