ArcEngine打开MXD文件

ArcEngine打开MXD文件

using System.Windows.Forms;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.Carto;
  public void JoinSHP(AxMapControl e, AxTOCControl a)
        {
              OpenFileDialog op = new OpenFileDialog();
                op.Filter = "ArcMap文档(*.mxd)|*.mxd";
                op.Title = "打开文档";
                op.RestoreDirectory = true;
                if (op.ShowDialog() == DialogResult.OK)
                {
                    string pFilePath = op.FileName;
                    IMapDocument pm = new MapDocument();
                    pm.Open(pFilePath, "");
                    e.Map = pm.ActiveView.FocusMap;
                    e.ActiveView.Refresh();
                }
       }
©️2020 CSDN 皮肤主题: 数字20 设计师:CSDN官方博客 返回首页