Enum.GetNames

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • J. Marcelo Barbieri

    Enum.GetNames

    a.. How can I return all the values in a enumerator. I tried like the
    following, but it doesn't work and there are no examples in the VS Help:
    enum test {a, b, c}
    Console.WriteLi ne(Enum.GetName s(test));
    thanks,



  • Sasha Imamovich

    #2
    Re: Enum.GetNames

    Marcelo try something like this:

    foreach(string t in Enum.GetNames (typeof(test)))

    Console.WriteLi ne (t);

    HTH,

    Sasha Imamovich



    "J. Marcelo Barbieri" <mbarbieri@bf.c om.br> wrote in message
    news:#rTvMMnRDH A.2248@TK2MSFTN GP12.phx.gbl...[color=blue]
    > a.. How can I return all the values in a enumerator. I tried like the
    > following, but it doesn't work and there are no examples in the VS Help:
    > enum test {a, b, c}
    > Console.WriteLi ne(Enum.GetName s(test));
    > thanks,
    >
    >
    >[/color]


    Comment

    Working...