[ 来源:http://www.it55.com | 作者: | 时间:2007-10-16 | 收藏 | 推荐 ] 【大 中 小】
using System;
namespace PSP
{
class GetEnumValues
{
public static void Main()
{
Type Sexs = typeof(SexKind);
Console.WriteLine("The kinds of the Sex:");
foreach (string s in Enum.GetNames(Sexs))
{
Console.WriteLine(s);
}
}
}
enum SexKind
{
Male,
Female
}
}
(编辑:IT资讯之家 www.it55.com)