Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
WebDAV .NET for Exchange
>
Tutorial
> Create journal
The following example shows you how to create journal. Journal will be saved in Journal 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); Journal journal1 = new Journal(); journal1.Subject = "journal1"; journal1.Body = "Body text."; journal1.StartDate = DateTime.Now; journal1.EndDate = DateTime.Now.AddMinutes(5); journal1.Entry = "Phone Call"; journal1.Type = "Phone Call"; MultiStatus multiStatus = resource.CreateItem(journal1); string journalUrl = multiStatus.Response[0].HRef; Console.WriteLine("Url of just created journal = " + journalUrl); Console.WriteLine("Press ENTER to exit"); Console.Read(); } } }
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) Dim journal1 As Journal = New Journal journal1.Subject = "journal1" journal1.Body = "Body text." journal1.StartDate = DateTime.Now journal1.EndDate = DateTime.Now.AddMinutes(5) journal1.Entry = "Phone Call" journal1.Type = "Phone Call" Dim multiStatus As MultiStatus = resource.CreateItem(journal1) Dim journalUrl As String = multiStatus.Response(0).HRef Console.WriteLine("Url of just created journal = " & journalUrl) Console.WriteLine("Press ENTER to exit") Console.Read() End Sub End Module