Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
WebDAV .NET for Exchange
>
Tutorial
> Retrieve tasks
The following example shows you how to retrieve single task or all tasks from specified folder.
C# example
using System; using System.Net; using Independentsoft.Webdav.Exchange; using Independentsoft.Webdav.Exchange.ContentClass; namespace Sample { class Program { static void Main(string[] args) { NetworkCredential credential = new NetworkCredential("username", "password"); WebdavSession session = new WebdavSession(credential); session.UserMailbox = "https://myserver/exchange/emailaddress"; Resource resource = new Resource(session); //retreive single task Task task1 = resource.GetTask("https://myserver/exchange/emailaddress/Tasks/task1.eml"); //retrieve all tasks from Tasks folder Task[] allTasks = resource.GetTasks(); //retrieve all tasks from specified folder Task[] myTasks = resource.GetTasks("https://myserver/exchange/emailaddress/MyTasks"); //retrieve all tasks from specified public folder Task[] publicTasks = resource.GetTasks("https://myserver/public/Tasks"); } } }
VB example
Imports System Imports System.Net Imports Independentsoft.Webdav.Exchange Imports Independentsoft.Webdav.Exchange.ContentClass Module Module1 Sub Main(ByVal args() As String) Dim credential As NetworkCredential = New NetworkCredential("username", "password") Dim session As WebdavSession = New WebdavSession(credential) session.UserMailbox = "https://myserver/exchange/emailaddress" Dim resource As Resource = New Resource(session) 'retreive single task Dim task1 As Task = resource.GetTask("https://myserver/exchange/emailaddress/Tasks/task1.eml") 'retrieve all tasks from Tasks folder Dim allTasks() As Task = resource.GetTasks() 'retrieve all tasks from specified folder Dim myTasks() As Task = resource.GetTasks("https://myserver/exchange/emailaddress/MyTasks") 'retrieve all tasks from specified public folder Dim publicTasks() As Task = resource.GetTasks("https://myserver/public/Tasks") End Sub End Module