[Fact] public void Test() { int? i = 2; var t = Enum.Parse(typeof(ReportTypeEnum), i.ToString());//AntiFraud var t2 = (ReportTypeEnum)i;//AntiFraud var result = string.Empty; switch (t2) { case ReportTypeEnum.AntiFraud: result = t.ToString();//AntiFraud break; } } public enum ReportTypeEnum { AntiFraud = 2, CreditCheck = 11 }
标签:转换,ReportTypeEnum,C#,枚举,result,var,public,AntiFraud From: https://www.cnblogs.com/hofmann/p/17641083.html