Copy images of any extension from Windows Forms C #

I have a problem when I try to copy images from different extensions (.TIF, .JPG or possibly guia1234__5858.jpg etc.).

Someone can tell me what to change so that the other pictures are copied with different extensions.

// create folder and copy pictures
total = (images! = null? images.Count: 0);
pbrImages.Maximum = total;
pbrImages.Value = 0;
pbrImages.Refresh ();
Counter = 0;
tmp = "of" + total.ToString ("0");
lblImages.Text = "0" + tmp;
Application.DoEvents ();
String date, path, file name;
long size = 0;
long fileSize = 0;
long cdSize = 0;
// long cdLimit = (optCD.Checked? 716800: 4194304); // 30720
long cdLimit = (optCD.Checked? (long) (CommonExtensions.Constants.CdSize * 1024): (long) (CommonExtensions.Constants.DvdSize * 1024)); // 30720
long tifs = 0;
int count = 0;
int cdTotal = 1;
if (images! = null && imagenes.Count> 0)
{
foreach (OrderServiceImagenInfo file in pictures)
{
if (file == null || commands == null) continue;

var arr = (from or in jobs where o.Guia.Trim (). Equals (file.Guia.Trim ()) o.EmailEmi selects) .ToArray ();
if (arr! = null && arr.Length> 0)
{
Date = arr[0];
if (date == null) next;
Path = GetParentDirectory (date);
String path = (folder1 + path);
// filename = file.Guia + ".tif"; -> Only works like this
String nro_guia = file.Guia.Trim ();
line[] Files = Directory.GetFiles (path, nro_guide +
". *"); -> it does not work that way
line[] archivos2 = Directory.GetFiles (ruta, nro_guia.)
+ "_ *"); -> it does not work that way
if (files.Length> 0)
{
img_red = files[0], ToString ();
fromPath = img_red;
}
if (files2.Length> 0)
{
imgs_red = archives2[0], ToString ();
fromPath = imgs_red;
}
line[] partes_nombre_guia = fromPath.Split (& # 39; \ & # 39;);
String nombre_guia =
partes_nombre_guia[partes_nombre_guia.Length - 1];

fromPath = Folder1 + "\" + path + "\" + filename;
if (cdSize> cdLimit)
{
cdTotal ++;
cdNumber ++;
cdPath = folder2 + string.Format ("\ {0} {1} \", cdType, cdNumber.ToString ("000"));
cdSize = 0;
}
toPath = cdPath + "Images \" + path;
try it
{
if (! System.IO.Directory.Exists (toPath)) System.IO.Directory.CreateDirectory (toPath);
}
catch (exception ex)
{
LoggingExtensions.WriteLog ("frmPrincipal", "GenerateData", "The folder could not be created:  n" + toPath, ex);
}

toPath = toPath + "\" + filename;
// copy image of network to local (C:  Temp)
try it
{
System.IO.File.Copy (fromPath, toPath, true);
System.IO.FileInfo fileInfo = new System.IO.FileInfo (toPath);
size = fileInfo.Length / 1024;
fileSize + = size;
cdSize + = size;
tifs ++;
ctrlD.UpdateCdNumber (file.Guia, cdNumber);
}
catch (exception ex)
{
LoggingExtensions.WriteLog ("FrmPrincipal", "GenerateData", "The file could not be copied from:  n" + fromPath + " n  na:  n" + toPath, ex);
}
counter ++;
lblImages.Text = counter.ToString ("0") + tmp;
pbrImages.Value = counter;
pbrImages.Refresh ();
Application.DoEvents ();
}
}
}