日期:2014-05-17 浏览次数:21166 次
enum days { Sunday = 1, Monday = 2 } static void Main() { string temp1 = "Sunday"; string temp2 = "2"; days getDay1 = (days)Enum.Parse(typeof(days), temp1); days getDay2 = (days)Enum.Parse(typeof(days), temp2); }