How can I redirect Console.Writeline to Response.Output?

Discussion in 'ASP .Net' started by =?Utf-8?B?QUFPTSBUaW0=?=, Mar 21, 2007.

  1. --
    Tim Meagher
     
    =?Utf-8?B?QUFPTSBUaW0=?=, Mar 21, 2007
    #1
    1. Advertising

  2. You can't. First off, there is no "Console" to write to in an ASP.NET app,
    that exists only on the server. I mean, you could certainly experiment with
    redirecting the output stream of the console class, but man it would be some
    ugly code.
    Is there any special reason why you need to try to do this?
    Peter

    --
    Site: http://www.eggheadcafe.com
    UnBlog: http://petesbloggerama.blogspot.com
    Short urls & more: http://ittyurl.net




    "AAOM Tim" wrote:

    >
    > --
    > Tim Meagher
     
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Mar 21, 2007
    #2
    1. Advertising

  3. I'm trying to share some logging classes between console applications and web
    apps in which if the logger fails than it dumps the log message to the
    console.

    --
    Tim Meagher


    "Peter Bromberg [C# MVP]" wrote:

    > You can't. First off, there is no "Console" to write to in an ASP.NET app,
    > that exists only on the server. I mean, you could certainly experiment with
    > redirecting the output stream of the console class, but man it would be some
    > ugly code.
    > Is there any special reason why you need to try to do this?
    > Peter
    >
    > --
    > Site: http://www.eggheadcafe.com
    > UnBlog: http://petesbloggerama.blogspot.com
    > Short urls & more: http://ittyurl.net
    >
    >
    >
    >
    > "AAOM Tim" wrote:
    >
    > >
    > > --
    > > Tim Meagher
     
    =?Utf-8?B?QUFPTSBUaW0=?=, Mar 21, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Grey

    Cannot use "Console.WriteLine"

    Grey, Apr 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,456
    =?Utf-8?B?U3VkaGFrYXIgU2FkYXNpdnVuaVtNVlBd?=
    Apr 13, 2004
  2. Replies:
    1
    Views:
    561
    john_teague
    Sep 1, 2005
  3. Tony Johansson
    Replies:
    2
    Views:
    752
    Patrice
    Jan 9, 2010
  4. Sal
    Replies:
    1
    Views:
    900
  5. AAOM Tim
    Replies:
    2
    Views:
    186
    AAOM Tim
    Mar 21, 2007
Loading...

Share This Page