Results 1 to 5 of 5

Thread: Console.WriteLine for dot net?

  1. #1
    Join Date
    Jan 2009
    Posts
    18

    Console.WriteLine for dot net?

    Hi,
    In my C# .net application.
    Console.WriteLine("Now let us begin!");
    However, the string, "Now let us begin!", never shows up in the "View"-
    Anyone can advise me on how to get the text show in the output?

  2. #2
    Join Date
    Jan 2009
    Posts
    38

    Re: Console.WriteLine for dot net?

    Well I must say Use

    Console.ReadLine();

    At the end.

  3. #3
    Join Date
    May 2008
    Posts
    63

    Re: Console.WriteLine for dot net?

    well its usually used when you use the emlator. The results go to a console window on your dekstop ahh here is an example
    http://www.codeproject.com/csharp/compacttcptrace.asp

  4. #4
    Join Date
    May 2008
    Posts
    2,297

    Re: Console.WriteLine for dot net?

    It goes to the output tab of that little window that also contains the task list. Depending on what you're writing there, you might have to hunt for it because Visual Studio writes its own stuff there, too.

  5. #5
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Console.WriteLine for dot net?

    In case of ASP.NET
    So let me rephrase your question to something analogous:

    When a tree falls in the woods does it makes a sound. The answer is, of course, "yes". But that doesn't help you since you already knew the answer. The real question is: "Is anyone listening?".

    So, back to your Console question. The answer is yes, the Console API is working (it's making a sound) but nobody's listening. IOW, no one's capturing the console output.

    Another option that you might consider is using the Trace APIs. Instead of Console.Write, try Trace.Write or Trace.Warn. For these APIs, somebody *is* listening as long as you enable tracing in your page by setting <%@ Page Trace=true%>. You can also set this application-wide in web.config, but then to see the trace info you'll have to browse to trace.axd.

Similar Threads

  1. Getting Writeline error in c#
    By Maal-Gaadi in forum Education Career and Job Discussions
    Replies: 6
    Last Post: 27-04-2011, 10:37 PM
  2. PC vs Console
    By Chitamacha in forum Video Games
    Replies: 6
    Last Post: 28-08-2010, 12:21 PM
  3. What is difference between write() and writeline()?
    By Harper 21 in forum Software Development
    Replies: 5
    Last Post: 22-01-2010, 09:00 AM
  4. Replies: 3
    Last Post: 03-09-2008, 01:39 PM
  5. Console
    By Fredrik Elestedt in forum Windows Server Help
    Replies: 11
    Last Post: 14-09-2007, 12:14 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,566,767.84871 seconds with 16 queries