HttpListener Constructor
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the HttpListener class.
public:
HttpListener();
public HttpListener ();
Public Sub New ()
Exceptions
This class cannot be used on the current operating system. Windows Server 2003 or Windows XP SP2 is required to use instances of this class.
Examples
The following code example demonstrates using the HttpListener constructor to create a new HttpListener object. For the complete example, see the HttpListener class topic.
// Set up a listener.
HttpListener listener = new HttpListener();
foreach (string s in prefixes)
{
listener.Prefixes.Add(s);
}
listener.Start();
For Each s As String In prefixes
listener.Prefixes.Add(s)
Next
listener.Start()
Remarks
Before using the instance returned by this constructor, you must invoke its Start method.
Notes to Callers
Note: This member outputs trace information when you enable network tracing in your application. For more information, see Network Tracing in the .NET Framework.