using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Dictionary<string, string> dic1 = GetEnumItemDesc(typeof(Days));
foreach (string key in dic1.Keys)
{
Console.WriteLine(key + ":{0}", dic1[key]);
}
Dictionary<string, string> dic = GetEnumItemValueDesc(typeof(Days));
foreach (string key in dic.Keys)
{
Console.WriteLine(key + ":{0}", dic[key]);
}
Console.WriteLine(string.Format(Days.Sunday.ToString() + ":{0}", GetEnumDesc(Days.Sunday)));
Console.WriteLine(string.Format("{0}", (i
c#枚举 获取枚举键值对、描述等
最新推荐文章于 2024-06-30 16:55:09 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)