I'm trying to find all jpg files in a specific directory, but i'm getting this error
Additional information: Could not find a part of the path 'C:\Users\myPC\Proj\Image Blur\bin\Debug\aaaa'.
private void backgroundWorker2_DoWork(object sender, DoWorkEventArgs e)
{
ApplyFilter(false);
string filepath = Environment.CurrentDirectory + "\\aaaa\\";
ImageFormat imgFormat = ImageFormat.Jpeg;
foreach (var imageFile in Directory.GetFiles(filepath, "*.jpg"))
{
string fullPath = filepath + imageFile;
try
{
ExtBitmap.BlurType blurType =
((ExtBitmap.BlurType)cmbBlurFilter.SelectedItem);
resultBitmap.ImageBlurFilter(blurType);
resultBitmap.Save(fullPath, imgFormat);
resultBitmap = null;
}
catch
{
}
}
}
The path does exist, and also contains jpg files