0

Hi... How do I get output debug messages generated by the debug mode (ie. Start with debugging)? If I can get them, I wish to display them to listbox that I have in the windows form I created. Is there a smarter way other than using the following? :

lstDebugMessage.Items.Add("Whatever is inside debug message");

Where lstDebugMessage is the listbox I generated in my windows form. Thanks for any ideas!

2
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by daidaiboyboy
0

So, if I understand correctly, when an error is thrown you want to add the error Message (the text) to a listbox?

If so this should do it.

THis example the program trys to open that file, and since it doesnt exist, its add the error to the listbox.

try
            {
                File.Open("C:\\dasdsds.txt",FileMode.Open);//Try to open

            }
            catch (Exception error)
            {
                listBox1.Items.Add(error.Message);
            }

Hope that helps :).

0

Erm sorry... not error messages. Some of my dlls generate some data output that prints to the console output screen (also same as debug output screen). I want to read the console output messages that my dlls generate. Sorry for the misunderstanding...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.