Bitmap bmp = new Bitmap(files2.FullName);
我有上面的代码,其中 files2 来自
foreach (FileInfo files2 in files)
当我处理大量图像时,它只对少数图像给出例外。谁可以帮我这个事?
谢谢
这是我的代码:
foreach (FileInfo files2 in files)
{
string nametime = files2.FullName.ToString();
DateTime createdTime = File.GetCreationTime(nametime);
//Console.WriteLine(createdTime);
//test
if (createdTime.ToShortDateString() == DateTime.Today.ToShortDateString())
{
try
{
if (files2.Extension == ".jpg" || files2.Extension == ".png" || files2.Extension == ".JPG" || files2.Extension == ".PNG" || files2.Extension == ".jpeg" || files2.Extension == ".JPEG")
{
Console.WriteLine("Name: " + files2.FullName);
Bitmap bmp = new Bitmap(files2.FullName);