Export (0) Print
Expand All

WebRequest Constructor ()

.NET Framework 1.1

Initializes a new instance of the WebRequest class.

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

Remarks

Use the Create method to initialize new WebRequest instances. Do not use the constructor.

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] 
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.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

WebRequest Class | WebRequest Members | System.Net Namespace | WebRequest Constructor Overload List

Show:
© 2014 Microsoft