1.定义枚举类型 public enum Test { 男 = 0, 女 = 1 } 2.获取枚举值 public void EnumsAction() { var s = Test.男;//男 var s2 = (int)Test.男;//0 var a = Test.男.ToString();//"男" var r = (Test)1;//女 var x = (Test)Enum.Parse(typeof(Test), "男");//男 var x2 = Enu…
代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 // ===============================================================================// Microsoft Data Access Application Block for .NET// http://msd…