| Visual Basic (Declaration) | |
|---|---|
Public ReadOnly Property Exception As Exception | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As SmtpEventArgs Dim value As Exception value = instance.Exception | |
| C# | |
|---|---|
public Exception Exception {get;} | |
| Managed Extensions for C++ | |
|---|---|
public: __property Exception* get_Exception(); | |
| C++/CLI | |
|---|---|
public: property Exception^ Exception { Exception^ get(); } | |
Property Value
If any exception occurred during the asynchronous operation, this property will contain an Exception object describing the exception.Check this property to tell if an exception occurred during the asynchronous operation. If this property is null, no exception occurred.
The exception property is useful for checking exceptions and handling them appropriately. For example, if a bad command was sent to the server, a ProtocolException may be thrown. You could check this property to see if it was of type ProtocolException, than handle appropriately.
Target Platforms: Microsoft .NET Framework 2.0
Copy Code