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"));  
       }  
}  

相关文章:

  • 2022-12-23
  • 2021-10-07
  • 2021-07-21
  • 2021-05-24
  • 2021-11-15
  • 2021-06-05
猜你喜欢
  • 2022-12-23
  • 2021-05-22
  • 2021-06-11
  • 2021-05-26
相关资源
相似解决方案