public void Log(string Text, bool AddStuff) { try { if (!File.Exists(logfile)) { File.WriteAllText(logfile, ""); } string log = File.ReadAllText(logfile); if (AddStuff) { Text = CS.Timestamp() + Text; } log = (log + CS.NL + Text); File.WriteAllText(logfile, log); } catch (IOException E) //log file in use, change the name { FileInfo FI = new FileInfo(logfile); logfile = FI.FullName.Replace(FI.Extension, "_.txt"); } }
internal static void AddThread(System.Threading.Thread T) { Threads.Add(T); CS.SysLog("[WF] Thread added."); }