| Visual Basic (Declaration) | |
|---|---|
Public ReadOnly Property Status As ImapStatus | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As ImapResponse Dim value As ImapStatus value = instance.Status | |
| C# | |
|---|---|
public ImapStatus Status {get;} | |
| Managed Extensions for C++ | |
|---|---|
public: __property ImapStatus get_Status(); | |
| C++/CLI | |
|---|---|
public: property ImapStatus Status { ImapStatus get(); } | |
Property Value
If status was included with the response, this property will return an ImapStatus value describing the status. If no status was included with the response, this property will return ImapStatus.None.The following example demonstrates sending a NOOP command and checking the response.
| Visual Basic | Copy Code |
|---|---|
' Login to the mail server Imap1.Login(Server, User, Pass) ' Send a NOOP command Dim Response As ImapResponse = Imap1.Noop() ' Check the response If Response.Status = ImapStatus.Ok Then Debug.WriteLine("Good response from server") Else Debug.WriteLine("Response from server: " + Response.Status) End ' Logout Imap1.Logout() | |
| C# | Copy Code |
|---|---|
// Login to the mail server imap1.Login(server, user, pass); // Send a NOOP command ImapResponse response = imap1.Noop(); // Check the response if(response.Status == ImapStatus.Ok) Debug.WriteLine("Good response from server"); else Debug.WriteLine("Response from server: " + response.Status); // Logout imap1.Logout(); | |
The ImapResponse.Status property contains an ImapStatus value indicating the status of a response from the IMAP server. Not all responses provide status. Typically, status responses come at the completion of a command execution. Whether an ImapResponse object contains status information is indicated by the ImapResponse.ResponseType property, in which case it will return ImapResponseType.Status.
For example, if the following line was received from the IMAP server,
A2 OK CAPABILITY completed
the ImapResponse.Status property would contain ImapStatus.Ok. This information is not included with all responses from the server.
Target Platforms: Microsoft .NET Framework 2.0
Copy Code