Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在使用 OpenFileDialog 时遇到问题。我用它在我的项目中选择一个图像。问题是我需要(好吧,我想要)限制对一个特定文件夹的访问(例如 c:\secretProyect\images )。可能吗?
你不能用标准的 OpenFileDialog 做到这一点。您可以自己创建一个自定义 OpenFileDialog,也许使用 ListView 列出秘密路径下的文件。
或者您可以在 OpenFileDialog 返回后检查文件,如果用户从禁止的段落中选择文件,则拒绝。