FileDrop - Files Only, No Folders

  • Thread starter Thread starter Joe Reggae
  • Start date Start date
J

Joe Reggae

I have a routine that fills a listbox with file and folder names dragged in
from Windows Explorer. I'd like to limit the listbox entries to file names.
Can someone advise me on how to distinguish between a file and folder so I
can block folder names? I'm building an array in the listbox DragDrop event
as follows ...

string[] s = (string[])e.Data.GetData(DataFormats.FileDrop, false);

Thanks.
 
I would think that you could just use System.IO.File.FileExists() to do what
you need. If it returns false, then the string from the drop must be a
folder.

There may be another way but the above seems easy enough.

-sb
 
Back
Top