Mohamed Moumni

Mohamed Moumni

  • NA
  • 48
  • 8.4k

how fix unreadable file selected in listbox c#winform

Jul 2 2017 3:03 PM
Hi, I have problem when I try to get files from a directory, but all those files contain a file doesn't exist in specific directory, I use this code for getting files
 
  1. FileInfo[] dr_files = dr.GetFiles();  
  2.               
  3.   
  4.               foreach (FileInfo f in dr_files)  
  5.               {  
  6.                   listBox3.Items.Add(f);  
  7.               } 
 here i get the files inlistbox but the file highlighted doesn't exist in directory
 
 when i double click to open the file that doesn't exist in directory from listbox(word file) I have this message
 
 

Answers (1)