0

Im trying to get the selected files path, from this list, i get those files by odf.SafeFileNames, is there a way to get those files paths?? here is my code

        ofd.Title = "=SE= File Selector v.01";

        ofd.Multiselect = true;


        if (ofd.ShowDialog() == DialogResult.OK)
        {

            fileNames = ofd.SafeFileNames;



        }

        foreach (string FileName in fileNames)
        {

                Console.WriteLine(FileName + ":  " + filepath);


        }

1 Answers1

2

SafeFileNames returns only file name and his extension Use FileNames instead to return full paths

if (ofd.ShowDialog() == DialogResult.OK)
{
     fileNames = ofd.FileNames;
}
Antoine V
  • 6,998
  • 2
  • 11
  • 34