Drag and Drop a Folder from Windows Explorer to listBox in C#

后端 未结 2 1262
伪装坚强ぢ
伪装坚强ぢ 2021-02-14 01:12

I succeeded in developing C# code for drag files from windows explorer to listBox.

    // Drag and Drop Files to Listbox
    private void listBox1_DragEnter(obje         


        
2条回答
  •  旧时难觅i
    2021-02-14 01:46

    if fileName is a directory you can create a DirectoryInfo object and loop through all files (and subdirs)

    you can have a look at this code:

    http://weblogs.asp.net/israelio/archive/2004/06/23/162913.aspx

    (you dont need to use a DirectoryInfo object, you can also use the static methods from the Directory class

提交回复
热议问题