process - synchronization processes with read & write to file c# -


i trying stop other processes reading , writing file need synchronize between process,how can it?

it helpful if give me pattern it, , show me should enter read , write section in code.

alright. easy thing thought if that's aim. can use filestream open file. like..

using (var stream = new filestream(                             @"c:\files\yourfile.txt",                              filemode.open,                              fileaccess.readwrite,                              // that's important parameter set                             // locks file other processes                             // long stream persists                             fileshare.none)) {     // give logic ... } 

messed up. didn't note questions intention, bad. if try close process reading/writing file. try find out which , kill it.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -