Class WebException
Defines the exception that is thrown by WebRequest instances when an error occurs.
public class WebException : InvalidOperationException
- Inheritance
-
WebException
- Inherited Members
- Extension Methods
Remarks
This class is a subclass of
Constructors
WebException()
The default constructor.
public WebException()
WebException(string)
Constructs a
public WebException(string message)
Parameters
message
stringThe message string for the exception.
WebException(string, Exception)
Constructs a
public WebException(string message, Exception innerException)
Parameters
message
stringThe message string for the exception.
innerException
ExceptionThe exception that caused this exception.
WebException(string, Exception, WebExceptionStatus, WebResponse)
Constructs a
public WebException(string message, Exception inner, WebExceptionStatus status, WebResponse response)
Parameters
message
stringMessage string for exception.
inner
ExceptionThe exception that caused this exception.
status
WebExceptionStatusThe network status of the exception.
response
WebResponseThe
WebResponse we have.
WebException(string, WebExceptionStatus)
Constructs a
public WebException(string message, WebExceptionStatus status)
Parameters
message
stringThe message string for the exception.
status
WebExceptionStatusThe network status of the exception.
Properties
Response
Gets the response that the remote host returned.
public WebResponse Response { get; }
Property Value
- WebResponse
If a response is available from the Internet resource, a
WebResponse instance that contains the error response from an Internet resource; otherwise,null .
Status
Gets the
public WebExceptionStatus Status { get; }
Property Value
- WebExceptionStatus
One of the WebExceptionStatus values.