大厦法定
class Program
{
enum Days { Saturday, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday };
enum BoilingPoints { Celcius = 100, Fahrenheit = 212 };
[FlagsAttribute]
enum Colors { Red = 1, Green = 2, Blue = 4, Yellow = 8 };
static void Main(string[] args)
{
Type weekdays = typeof(Days);
Type boiling = typeof(BoilingPoints);
Console.WriteLine("The days of the week, and their corresponding values in the Days Enum are:");
foreach (string s in Enum.GetNames(weekdays))
Console.WriteLine("{0,-11}= {1}", s, Enum.Format(weekdays, Enum.Parse(weekdays, s), "d"));
Console.ReadKey();
}
}
首先是第一个函数 enum.Format()
这是在公司中写的,因为网速太慢查找资料都要等好久。所以先写到这里啦