Click or drag to resize

IFolderAsyncGetFileAsync Method

IT Hit WebDAV Classes Reference
Gets the specified file from server.

Namespace:  ITHit.WebDAV.Client
Assembly:  ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll) Version: 2.0.420.0
Syntax
Task<IFileAsync> GetFileAsync(
	string name
)

Parameters

name
Type: SystemString
Name of the file.

Return Value

Type: TaskIFileAsync
File corresponding to requested name.
Exceptions
ExceptionCondition
UnauthorizedExceptionIncorrect credentials provided or insufficient permissions to access the requested item.
NotFoundExceptionThe requested resource doesn't exist on the server.
ForbiddenExceptionThe server refused to fulfill the request.
WebDavExceptionUnexpected error occurred.
Examples
string license = "<?xml version='1.0' encoding='utf...
WebDavSessionAsync session = new WebDavSessionAsync(license);
session.Credentials = new NetworkCredential("User1", "pwd");
IFolderAsync folder = await session.OpenFolderAsync(new Uri("http://server:8080/Sales"));
IFileAsync file = await folder.GetFileAsync("total.doc");
Console.WriteLine(file.LastModified);
See Also