枚举:enum SquareType { sqI, sqSquare, sqT, sqZleft, sqZright, sqLleft, sqLright }
现有
String type=SquareType.sql
SquareType nowtype;
怎么实现转换使得nowtype=type?
枚举:enum SquareType { sqI, sqSquare, sqT, sqZleft, sqZright, sqLleft, sqLright }
现有
String type=SquareType.sql
SquareType nowtype;
怎么实现转换使得nowtype=type?
SquareType nowtype=(SquareType)(Enum.Parse(typeof(Genders),type));
这个不需要多余的命名空间吧?是哪里报错了呢?