首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

在VS2010中使用C#枚举有关问题

2013-03-14 
在VS2010中使用C#枚举问题using Systemusing System.Collections.Genericusing System.Linqusing Syste

在VS2010中使用C#枚举问题
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 控制台下Csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            enum Day {q,w,e};
        };
    }
}
在VS2010中错误列表如下
错误1应输入 }E:\C#\控制台下Csharp\控制台下Csharp\Program.cs1110控制台下Csharp
错误2应输入类型、命名空间定义或文件尾E:\C#\控制台下Csharp\控制台下Csharp\Program.cs151控制台下Csharp

[解决办法]
 class Program
    { 
        enum Day {q,w,e};
        static void Main(string[] args)
        {
          
        };
    }
[解决办法]
enum类型你的先定义。
就像方法里不能定义类似的。

热点排行