Browse for a directory in C#

后端 未结 6 594
一向
一向 2020-12-24 10:14

How can I present a control to the user that allows him/her to select a directory?

There doesn\'t seem to be any native .net controls which do this?

6条回答
  •  死守一世寂寞
    2020-12-24 10:52

    Please don't try and roll your own with a TreeView/DirectoryInfo class. For one thing there are many nice features you get for free (icons/right-click/networks) by using SHBrowseForFolder. For another there are a edge cases/catches you will likely not be aware of.

提交回复
热议问题