Select either a file or folder from the same dialog in .NET

后端 未结 10 2101
别跟我提以往
别跟我提以往 2020-12-01 10:14

Is there an \"easy\" way to select either a file OR a folder from the same dialog?

In many apps I create I allow for both files or folders as input. Until now i alwa

10条回答
  •  南笙
    南笙 (楼主)
    2020-12-01 10:57

    http://www.pinvoke.net/default.aspx/shell32.shbrowseforfolder

    here is gerat link if you change in this sample

      bi.ulFlags = BIF_NEWDIALOGSTYLE | BIF_SHAREABLE;
    

    for

      bi.ulFlags = BIF_NEWDIALOGSTYLE | BIF_SHAREABLE | BIF_BROWSEINCLUDEFILES;
    

    you will get what you want

提交回复
热议问题