Export (0) Print
Expand All

WebRequest Constructor

.NET Framework 1.1

Initializes a new instance of the WebRequest class.

Overload List

Initializes a new instance of the WebRequest class.

Supported by the .NET Compact Framework.

[Visual Basic] Protected Sub New()
[C#] protected WebRequest();
[C++] protected: WebRequest();
[JScript] protected function WebRequest();

Initializes a new instance of the WebRequest class from the specified instances of the SerializationInfo and StreamingContext classes.

[Visual Basic] Protected Sub New(SerializationInfo, StreamingContext)
[C#] protected WebRequest(SerializationInfo, StreamingContext);
[C++] protected: WebRequest(SerializationInfo*, StreamingContext);
[JScript] protected function WebRequest(SerializationInfo, StreamingContext);

Example

[Visual Basic, C#, C++] The following example shows how to create a WebRequest instance by calling the Create method on the WebRequest class.

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of the WebRequest constructor. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
Dim myRequest As WebRequest = WebRequest.Create("http://www.contoso.com")


[C#] 
WebRequest myRequest = WebRequest.Create("http://www.contoso.com");


[C++] 
WebRequest* myRequest = WebRequest::Create(S"http://www.contoso.com");

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

WebRequest Class | WebRequest Members | System.Net Namespace

Show:
© 2014 Microsoft