On Wed, 2008-03-26 at 12:13 -0700, radzfoto wrote:
> I am a moderately experienced programmer especially in C and C++. I am just
> learning C#.
> 
> 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?
> 
> Here is the code:
> 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

this line ^^^ needs to be changed to:

                          Console.ReadLine();

>               }
>       }
> }
> 
> Thanks!
> Radzfoto
> 

before making the change, I was not able to compile your test program,
so I assume you must have had the "();" in your original source.

That said, I wasn't able to reproduce your problem:

[EMAIL PROTECTED] src]$ gmcs readln.cs 
[EMAIL PROTECTED] src]$ mono ./readln.exe 
Enter some text and press enter: sdffasfasfasfasf
This is the text you entered: sdffasfasfasfasf

In case you were maybe using mcs instead of gmcs, I tried again:

[EMAIL PROTECTED] src]$ mcs readln.cs 
[EMAIL PROTECTED] src]$ mono ./readln.exe 
Enter some text and press enter: asfasdasdasdas
This is the text you entered: asfasdasdasdas


Can you explain your problem a bit more?

Jeff


_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to