如何将枚举变量转换成数组? string[] arrColors = Enum.GetNames(typeof(System.ConsoleColor)); for (int i = 0; i < arrColors.Length; i++) { Console.WriteLine(arrColors[i]); } 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Array arrColors = Enum.GetValues(typeof(System.ConsoleColor)); for (int i = 0; i < arrColors.Length; i++) { Console.WriteLine(arrColors.GetValue(i)); } enum Colors { Red, Green, Blue, Yellow }; foreach (string s in Enum.GetNames(typeof(Colors))) Console.WriteLine(s); 一个网站统计访问量(用两个Application能用吗) 这里的模糊查询语句该怎么写? 存储过程里如何自动得到当前时间? 自定义控件中属性接收数据绑定 把数据插入到数据指定位置问题 我从数据库中根据SQL语句,得到数据,现在我想根据点击这些数据,得到这些数据的明细,这样就要打开链接时需要传递参数,不知如何实现?具体见 求指导sql语法 控件显示的问题 一般网站的在线人数的统计是怎么做的? Crystal report for .net 中如何将一列数据以行的形式现实出来(急) detailsview gridview问题@!! 菜鸟求路过大仙指点.谢谢
Array arrColors = Enum.GetValues(typeof(System.ConsoleColor)); for (int i = 0; i < arrColors.Length; i++)
{
Console.WriteLine(arrColors.GetValue(i));
}
foreach (string s in Enum.GetNames(typeof(Colors)))
Console.WriteLine(s);