F
Fabio R.
To support a webfarm scenario, I'd like to store a global array (serialized)
in a file on a network share.
In this array there is a list of pages "locked" by other users so I need to
read this array at every page access to detect if the page is "free" so the
user can access it; when the user can access the page, the page is added to
the array so the next user can't access.
What's the best way to lock this (network) file so when 2 users access the
same page, the first user changes the array (writing to file) and the second
user can only read the file after the first user has finished the task?
FileShare.None throw an error if the filestream is already open...
Thanks in advance for support and sorry for my not-so-good english language

Fabio
in a file on a network share.
In this array there is a list of pages "locked" by other users so I need to
read this array at every page access to detect if the page is "free" so the
user can access it; when the user can access the page, the page is added to
the array so the next user can't access.
What's the best way to lock this (network) file so when 2 users access the
same page, the first user changes the array (writing to file) and the second
user can only read the file after the first user has finished the task?
FileShare.None throw an error if the filestream is already open...
Thanks in advance for support and sorry for my not-so-good english language
Fabio