【发布时间】:2013-03-17 10:56:00
【问题描述】:
通过以下方式我能够阅读。
但是没有 dispose 方法,所以我以后无法删除文件。
所以下面的方法失败了。
我想不出合适的解决方案。
位图类在 C# 4.5 WPF 应用程序中无法识别。
谢谢
DirectoryInfo dInfo = new DirectoryInfo(@"C:\pokemon_files\images\");
FileInfo[] subFiles = dInfo.GetFiles();
BitmapImage myImg;
foreach (var vrImage in subFiles)
{
string srFilePath = vrImage.FullName;
System.Uri myUri = new Uri(srFilePath);
myImg = new BitmapImage(myUri);
if (myImg.Width < 50)
{
File.Delete(srFilePath);
continue;
}
}
【问题讨论】:
-
您收到哪条错误消息?
标签: c# wpf image .net-4.5 bitmapimage