Gets or sets the parameter information which modifies the ImapSearchParameter.Criterion.
Syntax
| Visual Basic (Declaration) | |
|---|
Public Property Parameter As String |
| Visual Basic (Usage) | Copy Code |
|---|
Dim instance As ImapSearchParameter
Dim value As String
instance.Parameter = value
value = instance.Parameter |
| C# | |
|---|
public string Parameter {get; set;} |
| Managed Extensions for C++ | |
|---|
public: __property string* get_Parameter();
public: __property void set_Parameter(
string* value
); |
Property Value
A string value which modifies the ImapSearchParameter.Criterion
Example
The following example demonstrates using the Mailbox.Search method. This example constructs the search "SEARCH FLAGGED SINCE 1-Feb-1994 NOT FROM 'Smith'"
| Visual Basic | Copy Code |
|---|
' Login
Imap1.Login(Server, User, Pass)
' Construct the search "SEARCH FLAGGED SINCE 1-Feb-1994 NOT FROM 'Smith'"
Dim Criteria As New ArrayList()
Criteria.Add(New ImapSearchParameter(ImapCriterion.Flagged, ""))
Criteria.Add(New ImapSearchParameter(ImapCriterion.Since, "1-Feb-1994"))
Criteria.Add(New ImapSearchParameter(ImapCriterion.Not, ""))
Criteria.Add(New ImapSearchParameter(ImapCriterion.From, "Smith"))
' Alternatively, ImapSearchParameter objects can be created like so
' Dim Param As New ImapSearchParameter()
' Param.Criterion = ImapCriterion.Flagged
' Param.Paramter = ""
' Criteria.Add(Param)
' Perform the search. This will occur on the default box INBOX.
Dim Messages() As ImapMessage = Imap1.CurrentMailbox.Search(Criteria)
' Display
Debug.WriteLine("The following message IDs meet the specified criteria")
Dim Message as ImapMessage
For Each Message in Messages
Debug.WriteLine(Message.Id) |
| C# | Copy Code |
|---|
// Login
imap1.Login(Server, User, Pass);
// Construct the search "SEARCH FLAGGED SINCE 1-Feb-1994 NOT FROM 'Smith'"
ArrayList criteria = new ArrayList();
criteria.Add(new ImapSearchParameter(ImapCriterion.Flagged, ""));
criteria.Add(new ImapSearchParameter(ImapCriterion.Since, "1-Feb-1994"));
criteria.Add(new ImapSearchParameter(ImapCriterion.Not, ""));
criteria.Add(new ImapSearchParameter(ImapCriterion.From, "Smith"));
/*
/ Alternatively, ImapSearchParameter objects can be created like so
/ ImapSearchParameter param = new ImapSearchParameter();
/ param.Criterion = ImapCriterion.Flagged;
/ param.Paramter = "";
/ criteria.Add(param);
*/
// Perform the search. This will occur on the default box INBOX.
ImapMessage[] messages = imap1.CurrentMailbox.Search(criteria);
// Display
Debug.WriteLine("The following message IDs meet the specified criteria");
foreach(ImapMessage message in messages)
Debug.WriteLine(message.Id); |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0
See Also