1.获取枚举变量collection
public static List<string> GetPartNameCollection()
{
List<string> collection = new List<string>();
Type part = typeof(HTMLPART);
foreach (string s in Enum.GetNames(part))
collection.Add(s);
return collection;
}
2.字符串转换成变量
Type part = typeof(HTMLPART);
HTMLPART EnumPartType = (HTMLPART)Enum.Parse(typeof(HTMLPART), PartName);
3.枚举变量获取INT值
int i=(int)HTMLPART.LOG
浙公网安备 33010602011771号