我需要某种对话框来浏览本地SMB网络以获取文件共享。 VBScript就是这样的。
Set application = CreateObject("Shell.Application")
Set folder = application.BrowseForFolder(0, "Moo!", &h250, &h12) ' &h12 sets
' Network as the root folder.
所以我添加了对Forms的引用并试图用FolderBrowserDialog来做,但令我惊讶的是:
FolderBrowserDialog dialog = new FolderBrowserDialog();
dialog.RootFolder = /* The Environment.SpecialFolder enumeration doesn't have
a value Network! */
dialog.RootFolder = (Environment.SpecialFolder)0x12; /* This dirty trick doesn't
work too. */
然后我在Windows API中寻找一个可以执行此操作的pinvokable函数,但没有找到任何函数。