C#打开文件对话框锁定到目录 [英] C# OpenFileDialog Lock To Directory

查看:554
本文介绍了C#打开文件对话框锁定到目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我提出,需要只能够让人们选择使用OpenFileDialog文件和文件夹都在同一个目录下的程序,而在更深的文件夹软件。我不想打开文件对话框能够为程序的当前目录之外选择的东西。这是可以做到的使用OpenFileDialog C#?

I am making a software that needs to ONLY be able allow people to select files and folders using the OpenFileDialog that are in the same directory as the program and that are in deeper folders. I don't want the OpenFileDialog to be able to select stuff outside of the program's current directory. Is this possible to do in C# using the OpenFileDialog?

请让我知道

感谢

推荐答案

您可以检查是否正确选择后的路径

you can check if the path is correct after selected

如果它只是接受或发送消息框,告诉他你选择不同的目录

if its just accept or send message box tell him you select different directory

这篇关于C#打开文件对话框锁定到目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆