枚举的遍历
Posted on 八月 16rd, 2007 由 admin
怎样遍历枚举中的每一个元素?
推荐阅读
网友:theares
using system;
using system.threading;
namespace theares
{
public class simple
{
public static void main()
{
foreach( mycity c in enum.getvalues( typeof( mycity ) ) )
console.writeline( c.tostring() );
console.readline();
}
}
enum mycity
{
beijing,shanghai
}
}


讨论区