Reading and writing to text file simultaneously
-
hi I use an aaplication which write to a log file every ~ 1sec. i need to build an appliaction that will display the contents of this and updtae the display as it works. i tried using StreamReader but was unsuccessful i get sharing violation when both apps trying to access the file. please help. :confused: Have a nice Day
-
hi I use an aaplication which write to a log file every ~ 1sec. i need to build an appliaction that will display the contents of this and updtae the display as it works. i tried using StreamReader but was unsuccessful i get sharing violation when both apps trying to access the file. please help. :confused: Have a nice Day
i think you need to use different threads for reading and writing, so as not to try to do both simultaneously. You will probably need to use
lock
keyword, as well asMonitor.Pulse
andMonitor.Wait
methods. Try reading the help on these and have a nice day too.:) there are no facts, only interpretations