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);

相关文章:

  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-11
  • 2021-12-01
  • 2021-10-12
  • 2021-06-20
猜你喜欢
  • 2022-03-05
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案