Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
WebDAV .NET for Exchange
>
Tutorial
> Retrieve notes
The following example shows you how to retrieve single note or all notes from specified folder.
C# example
using System; using System.Net; using Independentsoft.Webdav.Exchange; using Independentsoft.Webdav.Exchange.ContentClass; namespace ConsoleApplication1 { class Class1 { 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 note Note note1 = resource.GetNote("https://myserver/exchange/emailaddress/Notes/note1.eml"); //retrieve all notes from Notes folder Note[] allNotes = resource.GetNotes(); //retrieve all notes from specified folder Note[] myNotes = resource.GetNotes("https://myserver/exchange/emailaddress/MyNotes"); //retrieve all notes from specified public folder Note[] publicNotes = resource.GetNotes("https://myserver/public/Notes"); } } }
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 note Dim note1 As Note = resource.GetNote("https://myserver/exchange/emailaddress/Notes/note1.eml") 'retrieve all notes from Notes folder Dim allNotes() As Note = resource.GetNotes() 'retrieve all notes from specified folder Dim myNotes() As Note = resource.GetNotes("https://myserver/exchange/emailaddress/MyNotes") 'retrieve all notes from specified public folder Dim publicNotes() As Note = resource.GetNotes("https://myserver/public/Notes") End Sub End Module