string[] mypicture = System.IO.Directory.GetFiles("" + Application.StartupPath + @"\picture", "*.*", System.IO.SearchOption.AllDirectories); foreach (string mystr in mypicture) { string mypic = mystr.Substring(mystr.LastIndexOf("\\") + 1);