Visual C# 2008 控件设置路径 [英] Visual C# 2008 Control to set a path
本文介绍了Visual C# 2008 控件设置路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
Visual C# 2008 中的哪些控件允许我设置路径并获取该路径的值.
What control in Visual C# 2008 would allow me to set a path and get the value of that path.
例如:我希望用户单击一个按钮,然后选择一个路径,他/她将在其中执行操作,例如在所选路径中保存文件.
For example: I want the user to click a button then select a path where he/she would do the operation such as save a file in selected path.
推荐答案
您想要使用 FolderBrowserDiaglog
var folderBrowserDiaglog = new FolderBrowserDiaglog();
if ( folderBrowserDiaglog.ShowDialog() == DialogResult.OK )
{
string path = folderBrowserDiaglog.SelectedPath;
}
这篇关于Visual C# 2008 控件设置路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文