Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
WebDAV .NET for Exchange
>
Tutorial
> Create folder
The following example shows you how to create new folder.
C# example
using System; using System.Net; using Independentsoft.Webdav.Exchange; namespace Sample { class Program { static void Main(string[] args) { NetworkCredential credential = new NetworkCredential("username", "password"); WebdavSession session = new WebdavSession(credential); Resource resource = new Resource(session); //Create folder resource.CreateFolder("https://myserver/exchange/emailaddress/Test"); //Create Calendar folder inside mailbox resource.CreateFolder("https://myserver/exchange/emailaddress/MyCalendarBackup", FolderType.CalendarFolder); //Create public Contact folder resource.CreateFolder("https://myserver/public/Contacts", FolderType.ContactFolder); } } }
VB example
Imports System Imports System.Net Imports Independentsoft.Webdav.Exchange Module Module1 Sub Main(ByVal args() As String) Dim credential As NetworkCredential = New NetworkCredential("username", "password") Dim session As WebdavSession = New WebdavSession(credential) Dim resource As Resource = New Resource(session) 'Create folder resource.CreateFolder("https://myserver/exchange/emailaddress/Test") 'Create Calendar folder inside mailbox resource.CreateFolder("https://myserver/exchange/emailaddress/MyCalendarBackup", FolderType.CalendarFolder) 'Create public Contact folder resource.CreateFolder("https://myserver/public/Contacts", FolderType.ContactFolder) End Sub End Module