using System;
public class EnumTest {
enum Days { Saturday, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday };
public static void Main() {
Type weekdays = typeof(Days);
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"));
}
}
style="WIDTH: 490px; HEIGHT: 150px" align="center" marginwidth="0" marginheight="0" src="http://www.bloggao.com/script.aspx?userid=26256&AdType=0&AdstyleID=31302&Direction=1" frameborder="0" width="490" scrolling="no" height="150">
public class EnumTest {
enum Days { Saturday, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday };
public static void Main() {
Type weekdays = typeof(Days);
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"));
}
}
style="WIDTH: 490px; HEIGHT: 150px" align="center" marginwidth="0" marginheight="0" src="http://www.bloggao.com/script.aspx?userid=26256&AdType=0&AdstyleID=31302&Direction=1" frameborder="0" width="490" scrolling="no" height="150">