Click or drag to resize

XsWin32FileStream.Lock Method

X#
Prevents other processes from reading from or writing to the FileStream.

Namespace:  XSharp.IO
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 VIRTUAL METHOD Lock(
	position AS INT64,
	length AS INT64
) AS VOID
Request Example View Source

Parameters

position
Type: Int64
The beginning of the range to lock. The value of this parameter must be equal to or greater than zero (0).
length
Type: Int64
The range to be locked.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionposition or length is negative.
ObjectDisposedExceptionThe file is closed.
IOExceptionThe process cannot access the file because another process has locked a portion of the file.
Remarks
This method calls the Windows LockFile() function directly.
See Also