Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
| Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 10th, 2007, 01:26 PM
Registered User
 
Join Date: Aug 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Console application but no Console

I posted this in another forum, but that one looks pretty dead, So I'll cross post against my better judgement. :)

I'm working through Beginning Visual C# 2005. And I'm stuck on the first example. :)

The code is the following:

Code:
namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            //Hello World to Console hopefully
            Console.WriteLine("Hello World!");
            Console.ReadKey();
        }
    }
}
I've made sure of the following:

1) Visual C# developer settings are applied. It used to be VB.
2) I did an unistall and re-installed VS.
3) I made sure that Output Type was Console Application in Properties | Application Tab.
4) I've run it with Ctrl-F5. Which runs it without debugging. It does go to a console window then, But the ReadKey still does not seem to work.
5) I made sure that in Tool | Options | Debugging |Redirect all output to the quick console Option is unchecked.
6) I've tried adding another WriteLine after the ReadKey and put a breakpoint on it, and it does not get there and there is no console window.

I'm not sure what else to try.

Any ideas would be appreciated,

Greg

  #2 (permalink)  
Old August 22nd, 2007, 11:17 AM
Registered User
 
Join Date: Aug 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Change the readkey to readline

  #3 (permalink)  
Old August 22nd, 2007, 11:41 PM
Authorized User
Points: 129, Level: 2
Points: 129, Level: 2 Points: 129, Level: 2 Points: 129, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2007
Location: Gurgaon, Haryana, India.
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to vksingh24
Default

very true: tron_here

replace your Console.ReadKey() with Console.ReadLine()

__________________
Vikash Kumar Singh


Similar Threads
Thread Thread Starter Forum Replies Last Post
to run console application MunishBhatia ASP.NET 2.0 Professional 2 October 1st, 2007 01:25 AM
Printing from console application pilgrim7993 BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 1 December 16th, 2006 05:39 AM
Console Application digby_dog VB.NET 2002/2003 Basics 2 April 29th, 2005 10:52 AM
SendMail from a Console Application r_ganesh76 General .NET 3 March 1st, 2005 11:25 AM
Ending a console application FarCry VS.NET 2002/2003 9 May 26th, 2004 11:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.