PowerTCP Mail for .NET
ToString Method
See Also  Example Send comments on this topic.
Dart.PowerTCP.Mail Namespace > ImapResponse Class : ToString Method




Returns the entire response line.

Syntax

Visual Basic (Declaration) 
Public Overrides Function ToString() As String
Visual Basic (Usage)Copy Code
Dim instance As ImapResponse
Dim value As String
 
value = instance.ToString()
C# 
public override string ToString()
Managed Extensions for C++ 
public: string* ToString(); override 
C++/CLI 
public:
String^ ToString(); override 

Return Value

A string representation of the entire response line.

Example

The following example demonstrates using the LineReceived event to detect values of RECENT and EXISTS responses.
Visual BasicCopy Code
Private Sub ExamineTest()
   ' Login to the server.
   Imap1.Login(Server, User, Pass)

   ' Examine a mailbox.
   Dim Response As ImapResponse = Imap1.Examine("TestBox")

   ' Display the entire response from the server.
   Debug.WriteLine("Entire response from server: " + Response.ToString())
End Sub

Private Sub Imap1_LineReceived(ByVal sender As Object, ByVal e As Dart.PowerTCP.Mail.ImapResponseEventArgs) Handles Imap1.LineReceived
   Dim Response As ImapResponse
   For Each Response in e.Responses
      If Response.Operation = "EXISTS" Then
         Debug.WriteLine("Value of EXISTS: " + Response.Value)
      End If
      If Response.Operation = "RECENT" Then
         Debug.WriteLine("Value of RECENT: " + Response.Value)
      End If
   Next
End Sub
C#Copy Code
private void ExamineTest()
{
   // Login to the server.
   imap1.Login(Server, User, Pass);

   // Examine a mailbox.
   ImapResponse response = imap1.Examine("TestBox");

   // Display the entire response from the server.
   Debug.WriteLine("Entire response from server: " + response.ToString());
}

private void imap1_LineReceived(object sender, Dart.PowerTCP.Mail.ImapResponseEventArgs e)
{
   foreach(ImapResponse response in e.Responses)
   {
      if(response.Operation == "EXISTS")
         Debug.WriteLine("Value of EXISTS: " + response.Value);
      if(response.Operation == "RECENT")
         Debug.WriteLine("Value of RECENT: " + response.Value);
   }
}

Remarks

This method returns the entire response line as it was received from the server.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 3.2
© 2010 Dart Communications. All Rights Reserved.