Removes the lock.
| Exception Type | Condition |
|---|---|
| PreconditionFailedException | The item is not locked. |
| MethodNotAllowedException | The item does not support locking. |
| NotFoundException | The item doesn't exist on the server. |
| WebDavException | Unexpected error occurred. |
string license = "<?xml version='1.0' encoding='utf...
WebDavSession session = new WebDavSession(license);
session.Credentials = new NetworkCredential("User1", "pwd");
IHierarchyItem item = session.OpenResource(new Uri("http://server:8580/Products/Sales.txt"));
IFolder destFolder = session.OpenFolder(new Uri("http://server:8580/Info/"));
LockInfo lockInfo = item.Lock(LockScope.Shared, false, "User 1", new TimeSpan(0, 20, 0));
item.CopyTo(destFolder, "Copy of " + item.DisplayName, false, false);
item.Unlock(lockInfo.LockToken.LockToken);
IHierarchyItem Interface | ITHit.WebDAV.Client Namespace