| Visual Basic (Declaration) | |
|---|---|
Public ReadOnly Property Responses As ImapResponse() | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As ImapResponseEventArgs Dim value() As ImapResponse value = instance.Responses | |
| C# | |
|---|---|
public ImapResponse[] Responses {get;} | |
| Managed Extensions for C++ | |
|---|---|
public: __property ImapResponse*[]* get_Responses(); | |
| C++/CLI | |
|---|---|
public: property array<ImapResponse^>^ Responses { array<ImapResponse^>^ get(); } | |
Property Value
Returns an array of ImapResponse objects.The following example demonstrates using the LineReceived event to detect Status responses.
| Visual Basic | Copy Code |
|---|---|
Private Sub DoSomething() ' Log in. The Imap.LineReceived event will be raised when data is received Imap1.Login(Server, User, Pass) ' Send a NOOP Imap1.Noop() ' Log out Imap1.Logout() End Sub Private Sub Imap1_LineReceived(ByVal sender As Object, ByVal e As Dart.PowerTCP.Mail.ImapResponseEventArgs) Handles Imap1.LineReceived Dim Response As ImapResponse ' Iterate through all responses. For Each Response In e.Responses ' Check if it is a status response. If Response.ResponseType = ImapResponseType.Status Then Debug.WriteLine("The server has returned a status response") Debug.WriteLine("Status: " + Response.Status) Debug.WriteLine("Explanation: " + Response.Explanation) End If Next End Sub | |
| C# | Copy Code |
|---|---|
private void DoSomething() { // Log in. The Imap.LineReceived event will be raised when data is received imap1.Login(Server, User, Pass); // Send a NOOP imap1.Noop(); // Log out imap1.Logout(); } private void imap1_LineReceived(object sender, Dart.PowerTCP.Mail.ImapResponseEventArgs e) { // Iterate through all responses. foreach(ImapResponse response in e.Responses) { // Check if it is a status response. if(response.ResponseType == ImapResponseType.Status) { Debug.WriteLine("The server has returned a status response"); Debug.WriteLine("Status: " + response.Status); Debug.WriteLine("Explanation: " + response.Explanation); } } } | |
If a multi-line response is expected from the server, iterate through this collection to access each response. If a single line response is expected from the server, access Responses[0] or simply access the ImapResponseEventArgs.Response property, which contains the first response received.
Target Platforms: Microsoft .NET Framework 2.0
Copy Code