假设Resources里面资源文件都是图片:

//从资源文件查找,并释放到目录下
Resources res = new Resources();
foreach (PropertyInfo item in res.GetType().GetProperties(BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Instance))
{
  if (item.Name != "Culture" && item.Name != "ResourceManager")
  {
    if (item.GetValue(res, null) is Bitmap)
    {
      Bitmap b = item.GetValue(res, null) as Bitmap;
      if (!Directory.Exists(Path.Combine(Application.StartupPath, this.ImagePath)))
        Directory.CreateDirectory(Path.Combine(Application.StartupPath, this.ImagePath));
      b.Save(Path.Combine(Application.StartupPath, this.ImagePath + item.Name + ".gif"), System.Drawing.Imaging.ImageFormat.Gif);
    }
  }
}
View Code

相关文章:

  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2021-12-16
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
猜你喜欢
  • 2021-11-18
  • 2021-09-20
  • 2022-12-23
  • 2022-12-23
  • 2022-02-14
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案