Console.Write

Discussion in 'ASP .Net' started by Jim Heavey, Dec 3, 2003.

  1. Jim Heavey

    Jim Heavey Guest

    Realizing that I can use Debug.write to write a message to the "output"
    window, the Console.Write is accepted when keyed in, but where does the
    output go?
    Jim Heavey, Dec 3, 2003
    #1
    1. Advertising

  2. In a console application, Console.Write sends the output to the screen -
    like a DOS application.

    Mun




    "Jim Heavey" <> wrote in message
    news:Xns9446A84EA3F46JimHeaveyhotmailcom@207.46.248.16...
    > Realizing that I can use Debug.write to write a message to the "output"
    > window, the Console.Write is accepted when keyed in, but where does the
    > output go?
    Munsifali Rashid, Dec 3, 2003
    #2
    1. Advertising

  3. Jim Heavey

    Jim Heavey Guest

    Fine, but what does it do in an asp.net application?
    Jim Heavey, Dec 4, 2003
    #3
  4. I would presume it goes nowhere, as asp.net applications do not run in a
    console window. Or maybe the ouput goes to the console, but because there's
    no console window, it's not displayed. The compiler might also strip these
    commands out as they have no purpose in an asp.net application.

    As a quick test, I built a small windows app, with a single button, which
    would write to the console window when clicked. Like an asp.net
    application, it does not run at the command line, and I wanted to see what
    happens when you try and send output to, or get input from the console.

    private void button1_Click(object sender, System.EventArgs e)
    {
    MessageBox.Show(this, "starting");
    Console.WriteLine("Hello World");
    Console.ReadLine();
    MessageBox.Show(this, "ended");
    }

    No console window opened, and both the "starting" and "ended" message boxes
    displayed without any problems. Hence, I would guess that the compiler
    strips out the Console... lines out as they serve no purpose in a windows or
    asp.net application.

    Mun




    "Jim Heavey" <> wrote in message
    news:Xns9446E4794FF4JimHeaveyhotmailcom@207.46.248.16...
    > Fine, but what does it do in an asp.net application?
    Munsifali Rashid, Dec 4, 2003
    #4
    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. Peter Hansen
    Replies:
    1
    Views:
    369
    Joona I Palaste
    Aug 24, 2003
  2. Peter Hansen
    Replies:
    1
    Views:
    410
    Joona I Palaste
    Aug 24, 2003
  3. Ben Finney
    Replies:
    2
    Views:
    976
    Egor Bolonev
    Jun 30, 2003
  4. Egor Bolonev
    Replies:
    0
    Views:
    464
    Egor Bolonev
    Jun 30, 2003
  5. Serge Terekhoff
    Replies:
    0
    Views:
    631
    Serge Terekhoff
    Jun 30, 2003
Loading...

Share This Page