Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
This topic has not yet been rated - Rate this topic

How to: Register a Custom Protocol Using WebRequest

This example shows how to register a protocol specific class that is defined elsewhere. In this example, CustomWebRequestCreator is the user-implemented object that implements the Create method that returns the CustomWebRequest object. The code example assumes that you have written the CustomWebRequest code that implements the custom protocol.

Example

WebRequest.RegisterPrefix("custom", new CustomWebRequestCreator());
WebRequest req = WebRequest.Create("custom://customHost.contoso.com/");

Compiling the Code

This example requires:

References to the System.Net namespace.

See Also

Did you find this helpful?
(1500 characters remaining)

Community Additions

© 2013 Microsoft. All rights reserved.