IHierarchyItem.Unlock Method 

IT Hit WebDAV for .NET

Removes the lock.

[Visual Basic]
Sub Unlock( _
   ByVal lockToken As String _
)
[C#]
void Unlock(
   string lockToken
);

Exceptions

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.

Example

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);

See Also

IHierarchyItem Interface | ITHit.WebDAV.Client Namespace