为了账号安全,请及时绑定邮箱和手机立即绑定

关于C#小程序 不能运行?

关于C#小程序 不能运行?

aluckdog 2018-10-18 19:15:49
项目中添加一个类文件,该文件中定义一个方法,输出“学C#”,代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace EX5_1{class Class{class Demo{public void OutMethod(){Console.WriteLine("学C#");Console.Read();}}}}在自动生成的Program.cs文件中调用上述生成类文件中封装的方法,代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace EX5_1{class Program{static void Main(string[] args){Demo d = new Demo();d.OutMethod();}}}运行后的错误列表提示:找不到类型或命名空间名称“Demo”(是否缺少using指令或程序集引用?)第12行这照书搬下来的,高手赐教吧~~~~(>_<)~~~~
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 1006 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号