- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试这样做
FolderBrowserDialog dlg = new FolderBrowserDialog();
dlg.RootFolder = "C:\SomeUserSelectedFolder";
但是 RootFolder
是一个 System.Environment.SpecialFolder
。
这是否意味着我只能将它设置到像我的文档或桌面这样的地方?!?
最佳答案
这是正确的:如果 RootFolder
的分配值不是 Environment.SpecialFolder
值之一,则 an InvalidEnumArgumentException is raised .
你可以设置SelectedPath , 虽然:
If the SelectedPath property is set before showing the dialog box, the folder with this path will be the selected folder, as long as SelectedPath is set to an absolute path that is a subfolder of RootFolder (or more accurately, points to a subfolder of the shell namespace represented by RootFolder).
关于c# - 是否可以将 FolderBrowserDialog.RootFolder 设置为字符串中的任意路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7809370/
每当我调用 folderbrowserdialog.showDialog() 时,我的应用程序就会崩溃。我使用的是之前对我有用的代码,所以它不能是代码。 try { FolderBrowser
我有一个 FolderBrowserDialog,显示的代码如下所示。但是,它会一直打开并选择“计算机”,即文件夹树的根目录。如何让它在选定的文件夹上打开? var folderBrow
我有以下运行良好的 PowerShell 函数,但该窗口在 PowerShell ISE 后面的后台打开。 # Shows folder browser dialog box and sets to
鉴于该对话框被称为文件夹浏览器对话框,我怀疑答案是否定的,但是有没有办法让文件夹浏览器允许路径的文本输入,而不是强制浏览?我需要从网络共享中选择一个文件夹(并且只能选择一个文件夹),对话框中的整个浏览
我有一个文件夹。该文件夹中有多个文件夹,每个文件夹中有一个图像。像这样: Main Folder>Subfolder 1>Picture 1 Main Folder>Subfolder 2>Pictu
如果对话框点击Make new folder, just start editing the name just create a folder and click OK, OK dialogreza
您好,我在 visual studio 2013 中将 FolderBrowserDialog 与 wpf 一起使用,但我想删除按钮创建新文件夹,因为在我的应用程序中它毫无意义,我看到这篇文章 htt
我正在尝试使用 FolderBrowserDialog 在 C# 中选择一个文件夹。起初我得到了一个线程异常,所以我用谷歌搜索出了什么问题并修复了它,但现在我陷入了另一个问题。我想知道何时选择了文件夹
好的,这就是我正在努力实现的主要本质以及它正在做的事情的症状。 我有一个主窗体。在此表单上,用户可以单击将打开一个新的单独表单的按钮。此窗体将有一个按钮,该按钮应该显示 FolderBrowserDi
Windows 似乎在一些地方使用了一个更现代的对话框来浏览和选择文件夹(我在网上找到了这个屏幕截图,http://media.wiley.com/Lux/97/145397.image1.jpg),
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 3 年前。
我在使用 FolderBrowserDialog 的 fb.SelectedPath 函数时遇到问题。一切都很好,只要绝对路径不包含任何“.”。 例如: try { if (arg == 1)
这个问题在这里已经有了答案: show text box in FolderBrowserDialog (3 个答案) 关闭 5 年前。 我不确定要在这里谷歌什么来解释我想做什么,所以我会在这里尝试
这对我来说似乎很奇怪。我正在使用 FolderBrowserDialog 选择一个文件夹,该文件夹将成为一堆文件的目的地。每当在对话框中创建并选择一个文件夹时,当我之后在资源管理器中查看该文件夹时,生
我有一个带有 FolderBrowserDialog 的 winform,可以从网络驱动器中选择一个文件夹。问题在于它返回驱动器号 (X:\Folder...) 而不是网络路径 (\\Network\
我正在使用 System.Windows.Forms.FolderBrowserDialog 让用户选择一个位置。用户可以覆盖的默认位置位于 %appdata%。 只要用户在 %appdata% 以下
FolderBrowserDialog.RootFolder Property仅限于 Environment.SpecialFolder 中定义的特殊文件夹枚举器。然而在我的应用程序中,我们需要显示这
我对对话框表单有疑问。下面是一段调用 FolderBrowserDialog 窗口的 C# 代码。现在,当我在文件夹上单击“确定”时,它将关闭对话框,因此不必太担心。但是有谁知道如何检测取消事件?我试
在 C# 应用程序中使用 FolderBrowserDialog 时,我有一个非常奇怪的行为。显示 FolderBrowserDialog 后,某些事件不会在应用程序中触发,例如 Background
我正在开发一个简单的复制工具来从数码相机中复制文件。我已经编写了文件复制代码,我已经很好地连接了所有内容。 我遇到的问题似乎与 FolderBrowserDialog 有关。在 Vista 中(我还没
我是一名优秀的程序员,十分优秀!