On Wed, 2008-03-26 at 12:13 -0700, radzfoto wrote:
> I compiled the following under MS Visual Studio and it worked fine. However,
> exact same code fails to read the string using ReadLine. Any ideas that
> could help me out?

The code you attached failed to compile (because you were missing '()'
after your second Console.ReadLine call).  The attached source code
works for me:

                [EMAIL PROTECTED]:tmp$ mcs rl.cs 
                [EMAIL PROTECTED]:tmp$ mono rl.exe 
                Enter some text and press enter: l;kj;lkj;lkj;lkj
                This is the text you entered: l;kj;lkj;lkj;lkj

How is the program behaving that makes you say it fails?

Thanks,
 - Jon

using System;

namespace TestReadLine
{
        class MainClass
        {
                public static void Main(string[] args)
                {
                        string str;
                        
                        Console.Write("Enter some text and press enter: ");
                        str = Console.ReadLine();
                        Console.WriteLine("This is the text you entered: " + str);
                        Console.ReadLine ();
                }
        }
}
_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to