c# – 命名空间System.Drawing中不存在Point
发布时间:2020-12-15 05:37:29 所属栏目:百科 来源:网络整理
导读:我是C#的新手,并试图从教程中运行一个示例C#程序. 当我尝试运行以下代码时,我收到以下错误: Error 1 The type or namespace name ‘Point’ does not exist in the namespace ‘System.Drawing’ (are you missing an assembly reference?) C:UsersDocume
我是C#的新手,并试图从教程中运行一个示例C#程序.
当我尝试运行以下代码时,我收到以下错误:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Drawing; namespace HelloWorld { class Hello { static void Main() { Nullable<bool> b = false; if (b.HasValue) Console.WriteLine("b is {0}",b.Value); else Console.WriteLine("b is not set"); System.Drawing.Point p = new System.Drawing.Point(20,30); Console.WriteLine(b); Console.WriteLine("Hello World"); Console.WriteLine("Press any key to exit"); Console.ReadKey(); } } } 解决方法
在解决方案资源管理器中,右键单击“引用”,单击“添加引用”,单击“.NET”选项卡,然后滚动到“System.Drawing”.它应该工作.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐
- Formik官方应用案例解析(三)使用react-select
- ruby-on-rails – 资产管道路由助手解析为错误的
- objective-c – 以编程方式检查iPhone上是否安装
- c – qt未定义模板’QList’的隐式实例化
- cvc-complex-type.2.4.a: Invalid content was f
- Atitit 视图参数解决方案 oracle版和mysql版本 a
- ruby – 我可以使用gollum创建一个不是由Github托
- pg10,pg_suqences和pg_sequence
- cocos2dx中retain和release
- c# – 在本地存储Windows 8 Metro App中保存对象
热点阅读