7 Replies - 461 Views - Last Post: 01 December 2012 - 05:06 PM Rate Topic: -----

#1 Ap0C552  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 314
  • Joined: 08-December 10

System out

Posted 01 December 2012 - 03:30 PM

Hi,

I am building a windows forms application using C#.

I am just wondering how I can open and print out to the system console.

I tried these lines...

System.Console.OpenStandardOutput();
            System.Console.WriteLine("test");

Is This A Good Question/Topic? 0
  • +

Replies To: System out

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9287
  • View blog
  • Posts: 34,808
  • Joined: 12-June 08

Re: System out

Posted 01 December 2012 - 03:34 PM

There's no console - persay - that is with a windows form. You can write to the debug window with swapping out 'system.console' with 'debug'.
Was This Post Helpful? 0
  • +
  • -

#3 Ap0C552  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 314
  • Joined: 08-December 10

Re: System out

Posted 01 December 2012 - 03:36 PM

Ok I will try that. I just want to be able to quickly print out contents of lists and stuff for debugging purposes.

Thanks

EDIT:

Swapping in debug did not do anything. It is not recognized.

This post has been edited by Ap0C552: 01 December 2012 - 03:38 PM

Was This Post Helpful? 0
  • +
  • -

#4 Momerath  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1012
  • View blog
  • Posts: 2,444
  • Joined: 04-October 09

Re: System out

Posted 01 December 2012 - 03:51 PM

Debug is part of System.Diagnostics
Was This Post Helpful? 0
  • +
  • -

#5 Ap0C552  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 314
  • Joined: 08-December 10

Re: System out

Posted 01 December 2012 - 04:15 PM

Thanks

EDIT:

I tried this...

System.Diagnostics.Debug.Write("test");


I am not seeing anything.

BTW I am using Visual Studio

This post has been edited by Ap0C552: 01 December 2012 - 04:20 PM

Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9287
  • View blog
  • Posts: 34,808
  • Joined: 12-June 08

Re: System out

Posted 01 December 2012 - 04:37 PM

Do you have the debug output window open when this is running?
Was This Post Helpful? 0
  • +
  • -

#7 Ap0C552  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 314
  • Joined: 08-December 10

Re: System out

Posted 01 December 2012 - 04:51 PM

Ok ya I had to open the debug window. I am new to this IDE.

Thanks for the help.
Was This Post Helpful? 0
  • +
  • -

#8 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5537
  • View blog
  • Posts: 11,866
  • Joined: 02-June 10

Re: System out

Posted 01 December 2012 - 05:06 PM

View PostAp0C552, on 01 December 2012 - 04:36 PM, said:

Ok I will try that. I just want to be able to quickly print out contents of lists and stuff for debugging purposes.


Personally I take screen shots. Adding all that to console or debug windows still doesn't give you as much info nor as nicely formatted as already available in the Locals and Autos pallet.

And did you say "print"? Like on paper, to a printer? Who does that in this field? Every time you make a change all that info becomes void. You're going to go through reams of paper and spend more time printing than debugging. Just take a screen shot and look at the image. Not to mention you can splice a couple images side by side to see before and after results.

If you read through this tutorial you'll see screen shots of the debugging process and can see how helpful a screen capture can be without all the work of adding console.writeline lines or printing.
What does this error mean?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1