lock a file during execution of an app

  • Thread starter Thread starter Cyril Vi?ville
  • Start date Start date
C

Cyril Vi?ville

Hello,
I would like to block two files during the execution of my prog to
avoid that another prog modify them (write in).
Is that possible?
 
Use System.IO.FileShare.None to specify no sharing when you open the file,
and keep the file open as long as you don't want anyone else to access it.
 
Morten Wennevik said:
Use System.IO.FileShare.None to specify no sharing when you open the fil
e,
and keep the file open as long as you don't want anyone else to access i
t.

Really thx. Is it the only solution?
 
Back
Top