WebException Constructor (String, Exception, WebExceptionStatus, WebResponse)
Microsoft Silverlight will reach end of support after October 2021. Learn more.
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)
Syntax
'Declaration
Public Sub New ( _
message As String, _
innerException As Exception, _
status As WebExceptionStatus, _
response As WebResponse _
)
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.
Remarks
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 nulla null reference (Nothing in Visual Basic), the Message property is initialized to a system-supplied message.
Version Information
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
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.