PowerTCP Mail for .NET
Value Property
See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace > ImapResponse Class : Value Property




Gets the text returned by the server as the first value/token of the response.

Syntax

Visual Basic (Declaration) 
Public Property Value As String
Visual Basic (Usage)Copy Code
Dim instance As ImapResponse
Dim value As String
 
instance.Value = value
 
value = instance.Value
C# 
public string Value {get; set;}
Managed Extensions for C++ 
public: __property string* get_Value();
public: __property void set_Value( 
   string* value
);
C++/CLI 
public:
property String^ Value {
   String^ get();
   void set (    String^ value);
}

Property Value

The text indicating the value if returned; otherwise an empty string.

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 property returns the text returned by the server as the first value/token related to this response. For example, if the following line was received from the IMAP server,

* 99 EXISTS

the ImapResponse.Value property would contain "99". This information is not included with all responses from the server.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

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