easy question, but ...# DotNet - 窗口里的风景
c*o
1 楼
Many users will write to the same logfile, how can I make sure there is no
conflict when there are some concurrent access? I can't find a method to check
if the file is open or not.
Would you please add some sample code based on the following code? Thank you
so much!
StreamWriter sw=File.AppendText (sLogFile);
sw.WriteLine (DateTime.Now.ToLongTimeString ()+" "+sText);
sw.Flush ();
sw.Close ();
conflict when there are some concurrent access? I can't find a method to check
if the file is open or not.
Would you please add some sample code based on the following code? Thank you
so much!
StreamWriter sw=File.AppendText (sLogFile);
sw.WriteLine (DateTime.Now.ToLongTimeString ()+" "+sText);
sw.Flush ();
sw.Close ();