Namespace: ITHit.WebDAV.Client
Exception | Condition |
---|---|
NotFoundException | This item doesn't exist on the server. |
WebDavHttpException | Server returned unknown error. |
WebDavException | Unexpected error occurred. |
Renaming Item.
string license = "<?xml version='1.0' encoding='utf... WebDavSessionAsync session = new WebDavSessionAsync(license); session.Credentials = new NetworkCredential("User1", "pwd"); IFolderAsync folderSrc = await session.OpenFolderAsync(new Uri("http://server/My Folder/")); IFolderAsync folderDst = await folderSrc.GetParentAsync(); try { await folderSrc.MoveToAsync(folderDst, "My new name", false); } catch (PreconditionFailedException) { Console.WriteLine("The folder with such name already exists and 'overwrite' was 'false'."); }