ITPub博客

首页 > 应用开发 > > c# 的一个方法的bug

c# 的一个方法的bug

作者:flynike 时间:2019-08-20 09:50:53 0 删除 编辑
using System;
namespace ns{
class aa{

static void Main(string[] args){

string[] starray = new string[]{"Down the way nights are dark",
     "And the sun shines daily on the mountain top",
     "I took a trip on a sailing ship",
     "And when I reached Jamaica",
     "I made a stop"};

string aa= String.Join(".",starray);
Console.WriteLine(aa);
     Console.ReadKey() ;
}
}
}

错误:

Down the way nights are dark.And the sun shines daily on the mountain top.I took a trip on a sailing ship.And when I reached Jamaica.I made a stop

Unhandled Exception: System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected from a file. Try Console.Read.

at System.Console.ReadKey(Boolean intercept)

at ns.aa.Main(String[] args)

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2618/viewspace-3147587/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: activeX控件
请登录后发表评论 登录
全部评论

注册时间:2019-07-26

  • 博文量
    205
  • 访问量
    9820