using System;using System.Drawing;
namespace Example2
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Using
{
[STAThread]
static void Main(string[] args)
{
using(Font firstFont =new Font("Arial",10.0f),secondFont = new Font("Arial",10.0f))
{
}
Font ThirdFont = new Font("Arial",10.0f);
using(thirdFont)
{ }
}
}
}
出现错误了:e:\my documents\visual studio projects\example2\class1.cs(3,14): error CS0234: 类型或命名空间名称“Drawing”在类或命名空间“System”中不存在(是否缺少程序集引用?)
怎么办啊???????
namespace Example2
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
class Using
{
[STAThread]
static void Main(string[] args)
{
using(Font firstFont =new Font("Arial",10.0f),secondFont = new Font("Arial",10.0f))
{
}
Font ThirdFont = new Font("Arial",10.0f);
using(thirdFont)
{ }
}
}
}
出现错误了:e:\my documents\visual studio projects\example2\class1.cs(3,14): error CS0234: 类型或命名空间名称“Drawing”在类或命名空间“System”中不存在(是否缺少程序集引用?)
怎么办啊???????
System.Drawing.dll引用,在项目-〉引用-〉右击 添加 %winnt%/microsoft.net/framework/xxxxx/下
找到 System.Drawing.dll 添加