Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
WebDAV .NET for Exchange
>
Tutorial
> Check file or folder existence
The following example shows you how to check file or folder existence.
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); bool exist = resource.Exists("https://myserver/exchange/emailaddress/Calendar/appointment1.eml"); if (exist) { Console.WriteLine("Appointment exists"); } else { Console.WriteLine("Appointment does not exist"); } Console.Read(); } } }
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) Dim exist As Boolean = resource.Exists("https://myserver/exchange/emailaddress/Calendar/appointment1.eml") If (exist) Then Console.WriteLine("Appointment exists") Else Console.WriteLine("Appointment does not exist") End If Console.Read() End Sub End Module