选择路径的两种方法

//FolderBrowserDialog pDialog = new FolderBrowserDialog();
//pDialog.ShowNewFolderButton = false;
//pDialog.Description = "请选择输出点要素类路径";
//if (pDialog.ShowDialog() == DialogResult.OK)
//{
// //buttonEdit_OutputFeatureClass.Text = pDialog.SelectedPath + "\city.gdb\photos_points";
// buttonEdit_OutputFeatureClass.Text = pDialog.SelectedPath + "\point.shp";
//}
//pDialog.Dispose();

、、、、、、、、、、、、、、

、、、、、、、、、、、、、、

//选择线图层输出路径
SaveFileDialog pSaveFileDialog = new SaveFileDialog();
pSaveFileDialog.OverwritePrompt = true;//询问是否覆盖
pSaveFileDialog.Title = "输出矢量图层";
pSaveFileDialog.Filter = "矢量数据文件t(*.shp)|*.shp;";
if (pSaveFileDialog.ShowDialog() == DialogResult.OK)
{
string pFileName = pSaveFileDialog.FileName;
buttonEdit_OutputFeatureClass.Text = pFileName;//显示路径文本
}

原文地址:https://www.cnblogs.com/lzh5d/p/7814678.html