Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Locking A File

Status
Not open for further replies.

stevensteven

Programmer
Jan 5, 2004
108
CA
I have an ASP.NET application which uses a javascript to check a file.

I believe my application is freezing because its trying to read the file as another process is writing to it.

Is there some way in C# code that I can lock a file?

Thanks for any help,

Steven
 
You find examples in FileIOPermission class but I think for you FileStream.Lock() and FileStream.UnLock() will do the job.
-obislavu-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top