📜  从字符串或整数获取枚举值 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:47.983000             🧑  作者: Mango

代码示例1
MyEnum myEnum = (MyEnum)myInt;

MyEnum myEnum = (MyEnum)Enum.Parse(typeof(MyEnum), myString);