public enum  TypeEnum
    {
      
        Self = 1,
     
        Enterprise = 2

    }

 

枚举类型对象 TypeEnum.Self.Tostring() 之后的值是Self

 

枚举对象转换得到 1  (int)TypeEnum.Self之后的值是 1

  枚举类型  只能是int类型的值

 

 public class  TypeEnum
    {
      
        //个体
     public const int   Self = 1;
        //企业
     public const int    Enterprise = 2;
    }

 

 

类 类型对象 TypeEnum.Self.Tostring() 之后的值是  1 ;

 

 

 


本文转载:CSDN博客