Hi, I compiled and ran the interactive hello world program, and it seems that it ignored my Console.ReadLine() call. Since it's so short, I'll copy it right here:
// project created on 5/10/2007 at 4:02 PM
using System;
namespace InteractiveHelloWorld
{
class MainClass
{
static void Main(string[] args)
{
Console.Write("Please enter your name: ");
string name = Console.ReadLine();
Console.WriteLine
("Hello {0}, Good Luck in C#", name);
}
}
}
it compiled without errors or warnings, but the output I got was:
Please enter your name: Hello , Good Luck in C#
Has anyone else tried this in MonoDevelop and/or had this problem?
Comments
: seems that it ignored my Console.ReadLine() call. Since it's so
: short, I'll copy it right here:
:
: // project created on 5/10/2007 at 4:02 PM
: using System;
:
: namespace InteractiveHelloWorld
: {
: class MainClass
: {
: static void Main(string[] args)
: {
: Console.Write("Please enter your name: ");
: string name = Console.ReadLine();
: Console.WriteLine
: ("Hello {0}, Good Luck in C#", name);
: }
: }
: }
:
: it compiled without errors or warnings, but the output I got was:
:
: Please enter your name: Hello , Good Luck in C#
:
: Has anyone else tried this in MonoDevelop and/or had this problem?
:
I have the same problem, i tried writing an even simpler program and it is definatly the Console.ReadLine() part.
It seems to ignore it and continues with the other lines.
This is what i did:
using System
class Greeter
{
static void Main()
{
Console.Write("Enter your name : ");
string name = Console.ReadLine();
Console.WriteLine("Hello " + name );
Console.WriteLine("Gosh you are handsome! ");
}
}
Any help would be greatly appreciated.
Dim name as string=Console.readline()