字符串转换为枚举类型 Enum.Parse()

      例如:      

    MyType mytype = (MyType)Enum.Parse(typeof(MyType), "AValue");

原文地址:https://www.cnblogs.com/sungang3225/p/3758250.html