这个简单的程序为什么编译不了?

oilren 2004-05-02 07:43:15
原程序:
Hello.cs
//==================================================
class hello
{
public static void Main()
{
System.Windows.Forms.Messagebox.Show("Hello,World!");
}
}

用csc编译:csc /target:Winexe /out:hello.exe /r:System.dll,System.Windows.Forms.dll,System.Drawing.dll Hello.cs
为什么总是出错,显示:类型或命名空间名称"MessageBox"在类或命名空间"System.Windows.Forms"中不存在(是否缺少程序集引用?)
各位帮帮我,我错在那里?
...全文
36 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
oilren 2004-05-02
  • 打赏
  • 举报
回复
偶,明白了。多谢了。
liufeng82 2004-05-02
  • 打赏
  • 举报
回复
你程序中System.Windows.Forms.Messagebox.Show("Hello,World!");
中的Messagebox应写成MessageBox,C#中可是分大小写的呀。
fds2003 2004-05-02
  • 打赏
  • 举报
回复
什么错误呀?列出来!!!
oilren 2004-05-02
  • 打赏
  • 举报
回复
在前面加上:
using System;
using System.Drawing;
using System.Windows.Forms;
还是一样的错误信息呀。
fds2003 2004-05-02
  • 打赏
  • 举报
回复
你要添加这三个引用System.dll,System.Drawing.dll和System.Windows.Form.dll!

111,093

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧