FileStream.Unlock Method (Int64, Int64)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Allows access by other processes to all or part of a file that was previously locked.

Namespace:   System.IO
Assembly:  mscorlib (in mscorlib.dll)

abstract Unlock : 
        position:int64 *
        length:int64 -> unit
override Unlock : 
        position:int64 *
        length:int64 -> unit

Parameters

position
Type: System.Int64

The beginning of the range to unlock.

length
Type: System.Int64

The range to be unlocked.

Exception Condition
ArgumentOutOfRangeException

position or length is negative.

For a list of common file and directory operations, see Common I-O Tasks.

The following code example demonstrates how to lock part of a file so another process cannot access that part of the file even though it has read/write access to the file, and then unlock the specified part of the file . Run the program simultaneously in different command windows and investigate using the different console input options.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: