Click or drag to resize

WebDavSessionExistsAsync Method (Uri, IDictionaryString, String, CancellationToken)

IT Hit WebDAV Classes Reference
Checks whether specified uri exists.

Namespace:  ITHit.WebDAV.Client
Assembly:  ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll) Version: 6.0.4052-Beta
Syntax
public Task<bool> ExistsAsync(
	Uri uri,
	IDictionary<string, string> headers = null,
	CancellationToken cancellationToken = null
)

Parameters

uri
Type: SystemUri
Uri to item
headers (Optional)
Type: System.Collections.GenericIDictionaryString, String
Request headers.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
Propagates notification that operations should be canceled.

Return Value

Type: TaskBoolean
True, if specified item exists; false, otherwise.
Examples
string license = "<?xml version='1.0' encoding='utf...
WebDavSession session = new WebDavSession(license);
session.Credentials = new NetworkCredential("User1", "pwd");
bool isItemExists = await session.ExistsAsync(new Uri("https://server:8080/Library/"));
if(isItemExists)
    Console.WriteLine("Item exists");
else
    Console.WriteLine("Item not found");
See Also