Ubuntu Console.ReadLine 上的 Monodevelop 不起作用 [英] Monodevelop on Ubuntu Console.ReadLine doesn't work

查看:18
本文介绍了Ubuntu Console.ReadLine 上的 Monodevelop 不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Ubuntu 上的 Mono 平台上进行开发.但是我的第一个应用程序遇到了麻烦:)代码如下:

使用系统;使用 System.Threading;命名空间线程{类主类{公共静态无效主要(字符串[] args){Console.WriteLine("开始");字符串 x=Console.ReadLine();Console.WriteLine(x);Console.WriteLine("结束");}}

}

结果如下:

<上一页>开始结束

它们之间没有任何字符串,也没有从控制台读取数据,我也无法输入任何内容.问题是什么?也许我做错了什么?

我的环境:

<上一页>Ubuntu:Linux nozim-desktop 2.6.32-32-generic-pae单声道开发:版本:2.2.1构建日期:2010-03-09 16:12:25+0000

解决方案

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

选项/运行/常规/在外部控制台上运行

I'm trying to develop on Mono platform on Ubuntu. But I got trouble on my first application :) Here is the code:

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");
    }


}

}

And here is the result:

The start

the end

And no any string between them, and no reading from console happens, and I can't input anything. What is the problem? Maybe I do something wrong?

My environment:

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

解决方案

MonoDevelop's default console doesn't support ReadLine(), but you can set an option in the project options to launch an external console instead.

Options / Run / General / Run on external console

这篇关于Ubuntu Console.ReadLine 上的 Monodevelop 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆