草庐IT

ReportStatus

全部标签

c# - 为什么 Enum.GetValues() 在使用 "var"时返回名称?

谁能解释一下?alttexthttp://www.deviantsart.com/upload/g4knqc.pngusingSystem;namespaceTestEnum2342394834{classProgram{staticvoidMain(string[]args){//with"var"foreach(varvalueinEnum.GetValues(typeof(ReportStatus))){Console.WriteLine(value);}//with"int"foreach(intvalueinEnum.GetValues(typeof(ReportStatus

c# - 为什么 Enum.GetValues() 在使用 "var"时返回名称?

谁能解释一下?alttexthttp://www.deviantsart.com/upload/g4knqc.pngusingSystem;namespaceTestEnum2342394834{classProgram{staticvoidMain(string[]args){//with"var"foreach(varvalueinEnum.GetValues(typeof(ReportStatus))){Console.WriteLine(value);}//with"int"foreach(intvalueinEnum.GetValues(typeof(ReportStatus