foreach (string f in Directory.GetFiles(folderName))
{
if (f.ToLower().EndsWith(".jpg")==true || f.ToLower().EndsWith(".jpeg")==true)
{
this.listBox1.Items.Add(Path.GetFileNameWithoutExtension(f));
this.textBox1.Text = folderBrowserDialog1.SelectedPath;
}