WebException Constructor (String, Exception, WebExceptionStatus, WebResponse)
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Initializes a new instance of the WebException class with the specified error message, nested exception, status, and response.
Namespace: System.Net
Assembly: System.Http (in System.Http.dll)
Syntax
'Declaration
Public Sub New ( _
message As String, _
inner As Exception, _
status As WebExceptionStatus, _
response As WebResponse _
)
public WebException(
string message,
Exception inner,
WebExceptionStatus status,
WebResponse response
)
public:
WebException(
String^ message,
Exception^ inner,
WebExceptionStatus status,
WebResponse^ response
)
new :
message:string *
inner:Exception *
status:WebExceptionStatus *
response:WebResponse -> WebException
public function WebException(
message : String,
inner : Exception,
status : WebExceptionStatus,
response : WebResponse
)
Parameters
- message
Type: System. . :: . .String
The text of the error message.
- inner
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 inner, the Status property set to the value of status, and the Response property set to the value of response. If message is null Nothing nullptr unit a null reference (Nothing in Visual Basic) , the Message property is initialized to a system-supplied message.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.