protected void Page_Load(object sender, EventArgs e)
{
Type weekdays = typeof(Days);
Type boiling = typeof(BoilingPoints);
foreach (string str in Enum.GetNames(weekdays))
{
Response.Write("The days of the week, and their corresponding values in the Days Enum are: <span style=\"color:#F00;\">" + str + "</span><br>");
}
foreach (int bo in Enum.GetValues(boiling))
{
Response.Write(bo + "<br>");
}
}
protected enum Days
{
Saturday,
Sunday,
Monday,
Tuesday,
Wedenesday,
Thursday,
Friday
}
protected enum BoilingPoints
{
Celuis = 100,
Fahrenheit = 212
}
枚举学习
最新推荐文章于 2025-04-09 16:31:53 发布