2011-07-24 43 views
4

我试图在Ubuntu上的Mono平台上开发。 但我得到了我的第一个应用程序:) 这里的麻烦是代码:在Ubuntu Console.ReadLine上的Monodevelop不起作用

using System; 
using System.Threading; 

namespace threadings 
{ 
class MainClass 
{ 
    public static void Main (string[] args) 
    { 
     Console.WriteLine ("The start"); 
     string x=Console.ReadLine(); 
     Console.WriteLine(x); 
     Console.WriteLine ("the end"); 
    } 


} 

}

这里是结果:

 
The start 

the end 

而且它们之间没有任何字符串,没有从控制台读取发生,我不能输入任何东西。问题是什么?也许我做错了什么?

我的环境:

 
Ubuntu: Linux nozim-desktop 2.6.32-32-generic-pae 
MonoDevelop: 
     version: 2.2.1 
     Build date: 2010-03-09 16:12:25+0000 

回答

10

MonoDevelop中的默认控制台不支持的ReadLine(),但你可以设置在项目选择一个选项,以启动外部控制台。

选项/运行/一般/外部控制台

+0

哇上运行,谢谢,我会尽力:) – Nozim

+1

想补充一点,我是能够运行'的ReadLine()'用新鲜的安装MonoDevelop中的默认控制台就好了,我想他们固定了一些东西。 – lakesare

相关问题