Array values = Enum.GetValues( typeof( MessageState ) );
string[] names = Enum.GetNames( typeof( MessageState ) );
for (int i = 0; i < values.Length; i++)
{
Response.Write( (int)values.GetValue( i ) );
Response.Write( values.GetValue( i ).ToString() );
}
for (int i = 0; i < names.Length; i++)
{
Response.Write( names[i] );
}
转载于:https://www.cnblogs.com/smthts/archive/2012/04/25/2470728.html