ImapGetFolderStatus Method
Gets the status of the specified folder without selecting it.

Namespace: MailBee.ImapMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax
public FolderStatus GetFolderStatus(
	string folderName
)

Parameters

folderName
Type: SystemString
The full name of the folder to get the status information of.

Return Value

Type: FolderStatus
FolderStatus object if the status information was downloaded successfully; otherwise, a null reference (Nothing in Visual Basic).
Exceptions
ExceptionCondition
MailBeeExceptionAn error occurred and ThrowExceptions is true.
Remarks
This method can be used to obtain the folder status information such as total count of messages, recent messages count, unseen messages count, etc without selecting the folder.
Examples
This sample gets Inbox status information and displays unseen messages count. No folder is selected.
using System;
using MailBee;
using MailBee.ImapMail;

class Sample
{
     static void Main(string[] args)
     {
         Imap imp = new Imap();

            // Connect to the server and log in the account.
            imp.Connect("imap.server.com");
            imp.Login("jdoe@server.com", "secret");

            // Download Inbox folder status information.
            FolderStatus status = imp.GetFolderStatus("Inbox");

            Console.WriteLine(status.UnseenCount + " unseen message(s) in inbox");

            imp.Disconnect();
        }
    }
}
See Also