ITPub博客

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

c# 的一个方法的bug

作者:tzhang911 时间:2019-09-02 11:38:49 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/1926/viewspace-3160736/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-04-16

  • 博文量
    100
  • 访问量
    753