IList<string> lstsf = Enum.GetNames(typeof(Environment.SpecialFolder));
foreach (string sf in lstsf)
{
Environment.SpecialFolder sfType = (Environment.SpecialFolder)Enum.Parse(typeof(Environment.SpecialFolder), sf);
string specDir = Environment.GetFolderPath(sfType);
}
还有个Enum.GetValues 方法 .
通过名称转为枚举: Environment.SpecialFolder sfType = (Environment.SpecialFolder)Enum.Parse(typeof(Environment.SpecialFolder), sf);