Send output using Console.Write.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Boba

    #1

    Send output using Console.Write.

    Hi,

    I'm programming a WinForm application. I would like to
    enter commands that will send output that will help me to
    locate bugs in the future.

    I know that there is a way to send output by using the
    Console.Write command. The question is how can I see the
    outputs in the client machine ? Is there a specific
    programm to do it or Can I use the prompt window ?

    With thanks,
    Boba.
  • James

    #2
    Re: Send output using Console.Write.


    "Boba" <boba@boba.co m> wrote in message
    news:0af601c346 e0$2af7d710$a50 1280a@phx.gbl.. .[color=blue]
    > Hi,
    >
    > I'm programming a WinForm application. I would like to
    > enter commands that will send output that will help me to
    > locate bugs in the future.
    >
    > I know that there is a way to send output by using the
    > Console.Write command. The question is how can I see the
    > outputs in the client machine ? Is there a specific
    > programm to do it or Can I use the prompt window ?
    >
    > With thanks,
    > Boba.
    > .
    >[/color]

    You could take a look at System.Diagnost ics.TextWriterT raceListener - it
    allows you to dump text to a file. - and can have certain levels set on it.


    Comment

    • 100

      #3
      Re: Send output using Console.Write.

      Hi Boba,
      If you want to see your logs on the screen during developing you can make
      your project "Console Application" in project's Properties|Outp ut Type.This
      will open a console window every time you start the project. In this way all
      your Console.WriteLi ne logs will be visible on the screen. You have to make
      your application Windows Application again when you compile the release
      version, though. I haven't find a way to set "Console Application" for the
      debug and "Windows Application" for the release versions of my projects.
      Your Console.WriteLi ne will stay in the release code, though. So the better
      idea I beliave is to use System.Diagnost ics.Debug.Write XXX methods. In this
      way you can see your lines in VS.NET's Output|Debug, which is not so
      comfortable, I think. The big advantage is that debug code will be in your
      code only when you compile the debug versions of the project.
      If you dislike (like I do) this Output window you can write and register
      your own listener. But what I do actually is to set my project as a "Console
      Application" and I put the folowing lines in the begining of my Main
      function:
      #if(DEBUG)

      System.Diagnost ics.Debug.Liste ners.Add(new
      System.Diagnost ics.TextWriterT raceListener(Co nsole.Out));

      #endif
      So, now I can see my output in the console window. All you have to do is to
      make sure you return back the Application's output type to "Windows
      Application" before the release compilation.

      HTH
      B/rgds
      100

      "Boba" <boba@boba.co m> wrote in message
      news:0af601c346 e0$2af7d710$a50 1280a@phx.gbl.. .[color=blue]
      > Hi,
      >
      > I'm programming a WinForm application. I would like to
      > enter commands that will send output that will help me to
      > locate bugs in the future.
      >
      > I know that there is a way to send output by using the
      > Console.Write command. The question is how can I see the
      > outputs in the client machine ? Is there a specific
      > programm to do it or Can I use the prompt window ?
      >
      > With thanks,
      > Boba.[/color]


      Comment

      Working...