ArcGIS Pro二次开发-选择gdb
ArcGIS Pro二次开发,版本是2.5,Vs2019,.net4.8
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using ArcGIS.Core.CIM; using ArcGIS.Core.Data; using ArcGIS.Core.Geometry; using ArcGIS.Desktop.Catalog; using ArcGIS.Desktop.Core; using ArcGIS.Desktop.Editing; using ArcGIS.Desktop.Extensions; using ArcGIS.Desktop.Framework; using ArcGIS.Desktop.Framework.Contracts; using ArcGIS.Desktop.Framework.Dialogs; using ArcGIS.Desktop.Framework.Threading.Tasks; using ArcGIS.Desktop.Mapping; namespace ProAppModule1 { internal class Button1 : Button { protected override void OnClick() { OpenItemDialog searchGdbDialog = new OpenItemDialog { Title = "Find GDB", InitialLocation = @"C:\Data", MultiSelect = false, Filter = ItemFilters.geodatabases }; var ok = searchGdbDialog.ShowDialog(); if (ok != true) return; var selectedItems = searchGdbDialog.Items; foreach (var selectedItem in selectedItems) { MessageBox.Show(selectedItem.Path); } } } }
参考:https://blog.csdn.net/jixg1800/article/details/104545026