using (FileStream fs = new FileStream(string.Format(@"{0}\Information logs\{1}", Properties.Settings.Default.InformationLogsDestination, logName), FileMode.Append, FileAccess.Write)) { StreamWriter w = new StreamWriter(fs, Encoding.UTF8); w.WriteLine(DateTime.Now.ToString("G") + " posting to '" + message + "' to list " + name + " in Database."); w.Flush(); w.Close(); fs.Close(); }
lock(myStaticVariable) { // Code to write to file. }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)