比如
public enum test
{
a1,
a2,
a3
}如果得到字符串 a1,a2,a3 ?

解决方案 »

  1.   

    test  tests =test.a1;
    string str=Convert.ToString(tests);
    你是这个意思?
      

  2.   

    string s = test.a1.ToString();
      

  3.   

    正解
    Enum.GetName( typeof(ChartType), series.ChartType )还是感谢大家
      

  4.   

    可以遍历出来的
    string[] str = Enum.GetNames(typeof(test));
      

  5.   

    使用Enum.GetNames方法,如下:
    foreach(string name in Enum.GetNames(typeof(test)))
    {
    Console.WriteLine(name);
    }
      

  6.   

    只要楼主不强制类型转换输出的就是你要的东东,如果强制转换成int型得到就是0,1,3 .....