[Mono-list] Doubt on "Console.ReadLine()" !!!!!

Alan McGovern alan.mcgovern at gmail.com
Fri Feb 13 09:06:33 EST 2009


Hi,

If you're running the code inside monodevelop, you cannot use
Console.ReadLine as MonoDevelop does not allow you to accept input via the
console when it executes an application. There is an active bug on this
issue.

Alan.

On Fri, Feb 13, 2009 at 1:40 PM, enementor <gymisi at gmail.com> wrote:

>
> Hi nsharath,
>
> This code works fine, but I think the monodevelop IDE integrated console
> has
> a mistake. You can run it from the command line. :)
>
> Regards,
> Mihály
>
> nsharath wrote:
> >
> > hello sir,
> > I am working on SUSE studio MONO 2.2.
> > I am able to run the "Console.WriteLine()" perfectly.
> > But the "Console.ReadLine()" is showing exceptions in the sample code.But
> > this code is running perfectly on the Windows Visual studio 2008.
> >
> > My doubt is : "HOW TO READ INPUT FROM USER" ??????
> >
> > - - - - - - - - - - - - - SAMPLE CODE TO FIRST THE HIGHEST 2 NUMBERS IN
> > GIVEN ARRAY - - - - - - - -
> > using System;
> > using System.Collections.Generic;
> > using System.Linq;
> > using System.Text;
> >
> > namespace practice
> > {
> >     class highest
> >     {
> >         public static void Main()
> >         {
> >             int n,first,second;
> >             Console.Write("enter size of array:");
> >             n = Int32.Parse(Console.ReadLine());
> >             int[] a = new int[n];
> >             for (int i = 0; i < a.Length; i++)
> >             {
> >                 Console.Write("enter number{0}:", (i+1));
> >                 a[i] = Int32.Parse(Console.ReadLine());
> >             }
> >             Big_func(a, out first, out second);
> >             Console.WriteLine("FIRST HIGHEST = " + first);
> >             Console.WriteLine("SECOND HIGHEST = " + second);
> >         }
> >         public static void Big_func(int[] a, out int first, out int
> > second)
> >         {
> >             first = 0;
> >             second = 0;
> >             foreach(int i in a)
> >             {
> >                 if (i > first)
> >                 {
> >                     second = first;
> >                     first = i;
> >                 }
> >                 else if (i > second && i < first)
> >                 {
> >                     second = i;
> >                 }
> >             }
> >         }
> >     }
> > }
> >
> > - - - - - - - - - - - - - the end - - - - - - - -
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Doubt-on-%22Console.ReadLine%28%29%22-%21%21%21%21%21-tp21992667p21996500.html
> Sent from the Mono - General mailing list archive at Nabble.com.
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20090213/2b0cf6ef/attachment.html 


More information about the Mono-list mailing list