[导入](论坛答疑点滴)遍历枚举
2007-02-05 22:20
253 查看
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"));
}
}
lovecherry 2006-01-19 11:26 发表评论
文章来源:http://www.cnblogs.com/lovecherry/archive/2006/01/19/320151.html
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"));
}
}
lovecherry 2006-01-19 11:26 发表评论
文章来源:http://www.cnblogs.com/lovecherry/archive/2006/01/19/320151.html
相关文章推荐
- (论坛答疑点滴)遍历枚举
- (论坛答疑点滴)__doPostBack()无效?
- 转: (论坛答疑点滴)winform下怎么得到按钮的click事件的处理方法
- (论坛答疑点滴)怎么触发DataGrid模板列中控件的事件?
- (论坛答疑点滴)DataGrid模板列中控件的事件中怎么知道是哪行触发的事件?
- (论坛答疑点滴)Datagrid怎么根据选择的checkbox编辑和更新多行记录?
- (论坛答疑点滴)用户控件动态加载PostBack后的问题
- (论坛答疑点滴)怎么给Table动态添加控件并且得到控件的值?
- (论坛答疑点滴)如何按照HashTable动态设定类的属性和字段?
- (论坛答疑点滴)上传控件怎么修改样式?怎么设置readonly?
- (论坛答疑点滴)DataGrid在PostBack后定位记录的简单办法
- (论坛答疑点滴)如何在用户控件内得到包含这个用户控件的页面中的控件的值
- (论坛答疑点滴)如何利用DataGrid纵向显示数据?
- (论坛答疑点滴)有关sql注入
- (论坛答疑点滴)如何向某网址Post信息,并得到CookieContainer以便以后直接通过验证
- (论坛答疑点滴)小处见大问题
- (论坛答疑点滴)winform下怎么得到按钮的click事件的处理方法
- (论坛答疑点滴)如何利用DataGrid纵向显示数据?
- (论坛答疑点滴)如何对动态的对象进行操作,属性付值
- (论坛答疑点滴)按回车触发按钮click事件的问题