点击或拖拽改变大小

FileStreamExensions.SafeLock Method

X#
Locks a region in a stream. Contains TRY CATCH mechanism.

命名空间:  XSharp
程序集:  XSharp.Core (在 XSharp.Core.dll 中) 版本:2.24 GA
Syntax
 STATIC METHOD SafeLock(
	SELF oStream AS FileStream,
	offset AS INT64,
	length AS INT64
) AS LOGIC
Request Example 查看代码

Parameters

oStream
类型:FileStream
The stream to lock.
offset
类型:Int64
Start of the region to lock. The method checks to see that the location is >= 0.
length
类型:Int64
Size of the region to lock. The method checks to see that the size is > 0.

Return Value

类型:Logic
TRUE when succesfull, FALSE when an exception occurred during reading or when offset or length were invalid.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type FileStream. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also