B Brian Henry Mar 3, 2004 #1 Is there an easy way to make a copy of all the debug.writeline stuff go to a log file also? thanks!
K Ken Tucker [MVP] Mar 3, 2004 #2 Hi, Use trace instead of debug. Add a textwriterlistener to the trace listeners. Dim fs As New System.IO.FileStream("C:\Test.txt", IO.FileMode.Append) Dim myTextListener As New TextWriterTraceListener(fs) Trace.Listeners.Add(myTextListener) Dim environmentVariables As IDictionary = Environment.GetEnvironmentVariables() Dim de As DictionaryEntry For Each de In environmentVariables Trace.WriteLine(String.Format(" {0} = {1}", de.Key, de.Value)) Next de Ken
Hi, Use trace instead of debug. Add a textwriterlistener to the trace listeners. Dim fs As New System.IO.FileStream("C:\Test.txt", IO.FileMode.Append) Dim myTextListener As New TextWriterTraceListener(fs) Trace.Listeners.Add(myTextListener) Dim environmentVariables As IDictionary = Environment.GetEnvironmentVariables() Dim de As DictionaryEntry For Each de In environmentVariables Trace.WriteLine(String.Format(" {0} = {1}", de.Key, de.Value)) Next de Ken