string foldername = ".""";
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
foldername = folderBrowserDialog1.SelectedPath;
}
if (System.IO.Directory.Exists(foldername))
{
System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(foldername);
System.IO.FileInfo[] fi = di.GetFiles("*.wmf");
if (fi.Length != 0)
{
foreach (FileInfo f in fi)
{
MessageBox.Show(f.ToString());
}
}
}