using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Diagnostics; using System.IO; namespace Examen31P_LebedevaAF { internal class Debugg { public static void DebTr() { Trace.Listeners.Add(new TextWriterTraceListener("Debug.txt")); Debug.Indent(); Trace.Indent(); Debug.WriteLine("Программа запущена: {0}", DateTime.Today); Trace.WriteLine("Программа запущена: {0}", Convert.ToString( DateTime.Today)); Debug.Flush(); //Debug.Indent(); //Trace.Listeners.Add(x); //Debug.WriteLine(st); //Debug.Flush(); //x.Close(); //string location = Environment.CurrentDirectory; //location = location.Remove(location.Length - 6, 6); //location = location.Insert(location.Length, "Diagnostic.txt"); //TextWriterTraceListener tr = new TextWriterTraceListener(File.AppendText(location)); //Debug.Listeners.Add(tr); //Debug.WriteLine(s); //Debug.Flush(); //tr.Close(); //TextWriterTraceListener x = new TextWriterTraceListener(File.AppendText("diagnostic.txt")); //Trace.Listeners.Add(x); //Debug.WriteLine(st); //Debug.Flush(); //x.Close(); } } }