Cast a hashtable.Keys into List<int> or other IEnumerable<int>
问题 I know, I have other options, e.g. I could maintain a separate list of keys. Please don't suggest other options. I simply want to know if I can pull this off. Please don't ask me what problem I'm trying to solve, or anything like that. This is a pure and simple CS question. I want to know if anyone knows of a way to take the keys from a Hashtable and cast them into a List<int> or some other type of IEnumerable<int> (given of course that my keys are in fact integers). Given that I can do this