Export (0) Print
Expand All

WebException Constructor (String, Exception, WebExceptionStatus, WebResponse)

Initializes a new instance of the WebException class with the specified error message, nested exception, status, and response.

Namespace:  System.Net
Assembly:  System.Net (in System.Net.dll)

public WebException(
	string message,
	Exception innerException,
	WebExceptionStatus status,
	WebResponse response
)

Parameters

message
Type: System.String
The text of the error message.
innerException
Type: System.Exception
A nested exception.
status
Type: System.Net.WebExceptionStatus
One of the WebExceptionStatus values.
response
Type: System.Net.WebResponse
A WebResponse instance that contains the response from the remote host.

The WebException instance is initialized with the Message property set to the value of message, the InnerException property set to the value of innerException, the Status property set to the value of status, and the Response property set to the value of response. If message is null, the Message property is initialized to a system-supplied message.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft