Below is the simple C# code for getting the list of all public folders:
// Connect to Exchange Server
NetworkCredential credential = new NetworkCredential(username, password, domain);
ExchangeWebServiceClient client = new ExchangeWebServiceClient(mailboxURI, credential);
// Get list of public folders
ExchangeFolderInfoCollection folders = client.ListPublicFolders();
// Display folder name and sub-folder count
foreach (ExchangeFolderInfo publicFolder in folders)
{
Console.WriteLine(“Name: ” + publicFolder.DisplayName);
Console.WriteLine(“Subfolders count: ” + publicFolder.ChildFolderCount);
}
NetworkCredential credential = new NetworkCredential(username, password, domain);
ExchangeWebServiceClient client = new ExchangeWebServiceClient(mailboxURI, credential);
// Get list of public folders
ExchangeFolderInfoCollection folders = client.ListPublicFolders();
// Display folder name and sub-folder count
foreach (ExchangeFolderInfo publicFolder in folders)
{
Console.WriteLine(“Name: ” + publicFolder.DisplayName);
Console.WriteLine(“Subfolders count: ” + publicFolder.ChildFolderCount);
}
Some other new features and bug fixes are also included in this release. For release notes and download, please visit http://www.aspose.com/community/files/51/.net-components/aspose.network-for-.net/default.aspx.
No related posts.
