System.IO.FileStream.Unlock C# (CSharp) Method

Unlock() public method

public Unlock ( long position, long length ) : void
position long
length long
return void
        public virtual void Unlock(long position, long length)
        {
            if (position < 0 || length < 0)
            {
                throw new ArgumentOutOfRangeException(position < 0 ? nameof(position) : nameof(length), SR.ArgumentOutOfRange_NeedNonNegNum);
            }

            if (_fileHandle.IsClosed)
            {
                throw Error.GetFileNotOpen();
            }

            UnlockInternal(position, length);
        }

Usage Example

 static public int Unlock(IntPtr l)
 {
     try {
         System.IO.FileStream self = (System.IO.FileStream)checkSelf(l);
         System.Int64         a1;
         checkType(l, 2, out a1);
         System.Int64 a2;
         checkType(l, 3, out a2);
         self.Unlock(a1, a2);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
All Usage Examples Of System.IO.FileStream::Unlock