Sample Files:
This sample shows how to process HTTP requests from within an application.
For information about using the samples, see the following topics:
To build the sample using the command prompt
- Open a Command Prompt window and navigate to one of the language-specific subdirectories under the HttpListener directory. For information about required settings and the SDK Command Prompt, see How to: Set Sample Settings. 
- Type msbuild HttpListener.sln at the command line. 
To build the sample using Visual Studio
- Open Windows Explorer and navigate to one of the language-specific subdirectories under the HttpListener directory. 
- Double-click the icon for the HttpListener.sln to open the file in Visual Studio. 
- On the Build menu, click Build Solution. 
The application is built in the default \bin\Debug directory.
To run the sample
- Navigate to the directory that contains the new executable, using the command prompt or Windows Explorer. 
- Type HttpListener.exe at the command line, or double-click the icon for HttpListener.exe to launch it from Windows Explorer. .gif) Note Note- The sample builds a console application. You must launch and run it from a Command Prompt window to view its output. 
See Also
Reference
System.Net
HttpListener
HttpListenerContext
HttpListenerRequest
HttpListenerResponse