Prevents other processes from reading from or writing to the System.IO.FileStream.
Locking a range of a file stream gives the threads of the locking process exclusive access to that range of the file stream.
For a list of common file and directory operations, see Common I/O Tasks.