mscorlib(4.0.0.0) API with additions
System.Net.WebException Class Reference

The exception that is thrown when an error occurs while accessing the network through a pluggable protocol. More...

Inheritance diagram for System.Net.WebException:
[legend]
Collaboration diagram for System.Net.WebException:
[legend]

Public Member Functions

 WebException ()
 Initializes a new instance of the T:System.Net.WebException class. More...
 
 WebException (string message)
 Initializes a new instance of the T:System.Net.WebException class with the specified error message. More...
 
 WebException (string message, Exception innerException)
 Initializes a new instance of the T:System.Net.WebException class with the specified error message and nested exception. More...
 
 WebException (string message, WebExceptionStatus status)
 Initializes a new instance of the T:System.Net.WebException class with the specified error message and status. More...
 
 WebException (string message, Exception innerException, WebExceptionStatus status, WebResponse response)
 Initializes a new instance of the T:System.Net.WebException class with the specified error message, nested exception, status, and response. More...
 
override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
 Populates a T:System.Runtime.Serialization.SerializationInfo instance with the data needed to serialize the T:System.Net.WebException. More...
 
- Public Member Functions inherited from System.InvalidOperationException
 InvalidOperationException ()
 Initializes a new instance of the T:System.InvalidOperationException class. More...
 
 InvalidOperationException (string message)
 Initializes a new instance of the T:System.InvalidOperationException class with a specified error message. More...
 
 InvalidOperationException (string message, Exception innerException)
 Initializes a new instance of the T:System.InvalidOperationException class with a specified error message and a reference to the inner exception that is the cause of this exception. More...
 
- Public Member Functions inherited from System.SystemException
 SystemException ()
 Initializes a new instance of the T:System.SystemException class. More...
 
 SystemException (string message)
 Initializes a new instance of the T:System.SystemException class with a specified error message. More...
 
 SystemException (string message, Exception innerException)
 Initializes a new instance of the T:System.SystemException class with a specified error message and a reference to the inner exception that is the cause of this exception. More...
 
- Public Member Functions inherited from System.Exception
 Exception ()
 Initializes a new instance of the T:System.Exception class. More...
 
 Exception (string message)
 Initializes a new instance of the T:System.Exception class with a specified error message. More...
 
 Exception (string message, Exception innerException)
 Initializes a new instance of the T:System.Exception class with a specified error message and a reference to the inner exception that is the cause of this exception. More...
 
virtual Exception GetBaseException ()
 When overridden in a derived class, returns the T:System.Exception that is the root cause of one or more subsequent exceptions. More...
 
override string ToString ()
 Creates and returns a string representation of the current exception. More...
 
new Type GetType ()
 Gets the runtime type of the current instance. More...
 
- Public Member Functions inherited from System.Runtime.InteropServices._Exception
new bool Equals (object obj)
 Provides COM objects with version-independent access to the M:System.Object.Equals(System.Object) method. More...
 
new int GetHashCode ()
 Provides COM objects with version-independent access to the M:System.Object.GetHashCode method. More...
 

Protected Member Functions

 WebException (SerializationInfo serializationInfo, StreamingContext streamingContext)
 Initializes a new instance of the T:System.Net.WebException class from the specified T:System.Runtime.Serialization.SerializationInfo and T:System.Runtime.Serialization.StreamingContext instances. More...
 
- Protected Member Functions inherited from System.InvalidOperationException
 InvalidOperationException (SerializationInfo info, StreamingContext context)
 Initializes a new instance of the T:System.InvalidOperationException class with serialized data. More...
 
- Protected Member Functions inherited from System.SystemException
 SystemException (SerializationInfo info, StreamingContext context)
 Initializes a new instance of the T:System.SystemException class with serialized data. More...
 
- Protected Member Functions inherited from System.Exception
 Exception (SerializationInfo info, StreamingContext context)
 Initializes a new instance of the T:System.Exception class with serialized data. More...
 

Properties

WebExceptionStatus Status [get]
 Gets the status of the response. More...
 
WebResponse Response [get]
 Gets the response that the remote host returned. More...
 
- Properties inherited from System.Exception
virtual string Message [get]
 Gets a message that describes the current exception. More...
 
virtual IDictionary Data [get]
 Gets a collection of key/value pairs that provide additional user-defined information about the exception. More...
 
Exception InnerException [get]
 Gets the T:System.Exception instance that caused the current exception. More...
 
MethodBase TargetSite [get]
 Gets the method that throws the current exception. More...
 
virtual string StackTrace [get]
 Gets a string representation of the immediate frames on the call stack. More...
 
virtual string HelpLink [get, set]
 Gets or sets a link to the help file associated with this exception. More...
 
virtual string Source [get, set]
 Gets or sets the name of the application or the object that causes the error. More...
 
int HResult [get, protected set]
 Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. More...
 
EventHandler< SafeSerializationEventArgsSerializeObjectState
 Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception. More...
 
- Properties inherited from System.Runtime.InteropServices._Exception
string Message [get]
 Provides COM objects with version-independent access to the P:System.Exception.Message property. More...
 
string StackTrace [get]
 Provides COM objects with version-independent access to the P:System.Exception.StackTrace property. More...
 
string HelpLink [get, set]
 Provides COM objects with version-independent access to the P:System.Exception.HelpLink property. More...
 
string Source [get, set]
 Provides COM objects with version-independent access to the P:System.Exception.Source property. More...
 
Exception InnerException [get]
 Provides COM objects with version-independent access to the P:System.Exception.InnerException property. More...
 
MethodBase TargetSite [get]
 Provides COM objects with version-independent access to the P:System.Exception.TargetSite property. More...
 

Detailed Description

The exception that is thrown when an error occurs while accessing the network through a pluggable protocol.

Definition at line 9 of file WebException.cs.

Constructor & Destructor Documentation

◆ WebException() [1/6]

System.Net.WebException.WebException ( )

Initializes a new instance of the T:System.Net.WebException class.

Definition at line 46 of file WebException.cs.

◆ WebException() [2/6]

System.Net.WebException.WebException ( string  message)

Initializes a new instance of the T:System.Net.WebException class with the specified error message.

Parameters
messageThe text of the error message.

Definition at line 53 of file WebException.cs.

◆ WebException() [3/6]

System.Net.WebException.WebException ( string  message,
Exception  innerException 
)

Initializes a new instance of the T:System.Net.WebException class with the specified error message and nested exception.

Parameters
messageThe text of the error message.
innerExceptionA nested exception.

Definition at line 62 of file WebException.cs.

◆ WebException() [4/6]

System.Net.WebException.WebException ( string  message,
WebExceptionStatus  status 
)

Initializes a new instance of the T:System.Net.WebException class with the specified error message and status.

Parameters
messageThe text of the error message.
statusOne of the T:System.Net.WebExceptionStatus values.

Definition at line 71 of file WebException.cs.

◆ WebException() [5/6]

System.Net.WebException.WebException ( string  message,
Exception  innerException,
WebExceptionStatus  status,
WebResponse  response 
)

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

Parameters
messageThe text of the error message.
innerExceptionA nested exception.
statusOne of the T:System.Net.WebExceptionStatus values.
responseA T:System.Net.WebResponse instance that contains the response from the remote host.

Definition at line 87 of file WebException.cs.

◆ WebException() [6/6]

System.Net.WebException.WebException ( SerializationInfo  serializationInfo,
StreamingContext  streamingContext 
)
protected

Initializes a new instance of the T:System.Net.WebException class from the specified T:System.Runtime.Serialization.SerializationInfo and T:System.Runtime.Serialization.StreamingContext instances.

Parameters
serializationInfoA T:System.Runtime.Serialization.SerializationInfo that contains the information required to serialize the new T:System.Net.WebException.
streamingContextA T:System.Runtime.Serialization.StreamingContext that contains the source of the serialized stream that is associated with the new T:System.Net.WebException.

Definition at line 115 of file WebException.cs.

Member Function Documentation

◆ GetObjectData()

override void System.Net.WebException.GetObjectData ( SerializationInfo  serializationInfo,
StreamingContext  streamingContext 
)

Populates a T:System.Runtime.Serialization.SerializationInfo instance with the data needed to serialize the T:System.Net.WebException.

Parameters
serializationInfoThe T:System.Runtime.Serialization.SerializationInfo to be used.
streamingContextThe T:System.Runtime.Serialization.StreamingContext to be used.

Implements System.Runtime.Serialization.ISerializable.

Definition at line 133 of file WebException.cs.

Property Documentation

◆ Response

WebResponse System.Net.WebException.Response
get

Gets the response that the remote host returned.

Returns
If a response is available from the Internet resource, a T:System.Net.WebResponse instance that contains the error response from an Internet resource; otherwise, null.

Definition at line 34 of file WebException.cs.

◆ Status

WebExceptionStatus System.Net.WebException.Status
get

Gets the status of the response.

Returns
One of the T:System.Net.WebExceptionStatus values.

Definition at line 22 of file WebException.cs.


The documentation for this class was generated from the following file: