Hi, Environment.SpecialFolder , this returns a enum without having a public GetEnumerator(); ,
, can u tell me how to access the values like by using foreach statement?

Recommended Answers

All 3 Replies

Maybe this?

foreach(string s in Enum.GetNames(typeof(Environment.SpecialFolder)))
    Console.WriteLine(s);
commented: Nice! +7
commented: great answer & welcome to daniweb +4

Thanks that worked well.

As you're online. Please mark it as solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.