• 大小: 50KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-09
  • 语言: 其他
  • 标签: C#  

资源简介

arcengine和C# 开发GIS桌面版

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.SystemUI;


namespace aelesson1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender EventArgs e)
        {
            loadMapDocument();

        }
        private void loadMapDocument()
        {
            System.Windows.Forms.OpenFileDialog openFileDialog;
            openFileDialog = new OpenFileDialog();
            openFileDialog.title = “打开地图文档“;
            openFileDialog.Filter = “map documents(*.mxd)|*.mxd“;
            openFileDialog.ShowDialog();
            string filePath = openFileDialog.FileName;
            if (axMapControl1.CheckMxFile(filePath))
            {
                axMapControl1.MousePointer = esriControlsMousePointer.esriPointerHourglass;
                axMapControl1.LoadMxFile(filePath 0 Type.Missing);
                axMapControl1.MousePointer = esriControlsMousePointer.esriPointerDefault;

            }
            else
            
            {
                MessageBox.Show(filePath + “不是有效的地图文档“);

            }
        }

        private void button2_Click(object sender EventArgs e)
        {
            loadMapDocument2();
        }
        private void loadMapDocument2()
        {
            System.Windows.Forms.OpenFileDialog openFileDialog;
            openFileDialog = new OpenFileDialog();
            openFileDialog.title = “打开地图文档“;
            openFileDialog.Filter = “map documents(*.mxd)|*.mxd“;
            openFileDialog.ShowDialog();
            string filePath = openFileDialog.FileName;
            if (axMapControl1.CheckMxFile(filePath))
            {
                IArray arraymap = axMapControl1.ReadMxMaps(filePath Type.Missing);
                int i;
                IMap map;
                for (i = 0; i < arraymap.Count; i++)
                {
                    map = arraymap.get_Element(i) as IMap;
                    if (map.Name == “layers“)
                    {
                        axMapControl1.MousePointer = esriControlsMousePointer.esriPointerHourglass;
                        axMapControl1.LoadMxFile(filePath 0 Type.Missing);
                        axMapControl1.MousePointer = esriControlsMousePointer.esriPointerDefault;
                        break;


                    }

                }
            }

            else 
            {
                MessageBox.Show(filePath + “不是有效的地图文档“);
            }
        }

    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       5031  2012-06-14 14:16  aelesson1\aelesson1\aelesson1.csproj

     文件      12800  2012-06-14 15:59  aelesson1\aelesson1\bin\Debug\aelesson1.exe

     文件      24064  2012-06-14 15:59  aelesson1\aelesson1\bin\Debug\aelesson1.pdb

     文件      14328  2012-10-09 09:33  aelesson1\aelesson1\bin\Debug\aelesson1.vshost.exe

     文件        490  2007-07-21 01:33  aelesson1\aelesson1\bin\Debug\aelesson1.vshost.exe.manifest

     文件       2914  2012-06-14 15:59  aelesson1\aelesson1\Form1.cs

     文件       4567  2012-06-14 15:59  aelesson1\aelesson1\Form1.Designer.cs

     文件       9422  2012-06-14 15:59  aelesson1\aelesson1\Form1.resx

     文件        864  2012-10-09 09:33  aelesson1\aelesson1\obj\Debug\aelesson1.csproj.FileListAbsolute.txt

     文件        847  2012-06-14 15:59  aelesson1\aelesson1\obj\Debug\aelesson1.csproj.GenerateResource.Cache

     文件      12800  2012-06-14 15:59  aelesson1\aelesson1\obj\Debug\aelesson1.exe

     文件       2641  2012-06-14 15:59  aelesson1\aelesson1\obj\Debug\aelesson1.Form1.resources

     文件      24064  2012-06-14 15:59  aelesson1\aelesson1\obj\Debug\aelesson1.pdb

     文件        180  2012-06-14 14:16  aelesson1\aelesson1\obj\Debug\aelesson1.Properties.Resources.resources

     文件     112366  2012-06-14 14:16  aelesson1\aelesson1\obj\Debug\ResolveAssemblyReference.cache

     文件        490  2012-06-14 15:02  aelesson1\aelesson1\Program.cs

     文件       1380  2012-06-14 14:01  aelesson1\aelesson1\Properties\AssemblyInfo.cs

     文件       2868  2012-06-14 14:01  aelesson1\aelesson1\Properties\Resources.Designer.cs

     文件       5612  2012-06-14 14:01  aelesson1\aelesson1\Properties\Resources.resx

     文件       1094  2012-06-14 14:01  aelesson1\aelesson1\Properties\Settings.Designer.cs

     文件        249  2012-06-14 14:01  aelesson1\aelesson1\Properties\Settings.settings

     文件        917  2012-06-14 14:01  aelesson1\aelesson1.sln

    ..A..H.     19968  2012-10-09 09:39  aelesson1\aelesson1.suo

     目录          0  2012-08-08 09:46  aelesson1\aelesson1\obj\Debug\TempPE

     目录          0  2012-08-08 09:46  aelesson1\aelesson1\bin\Debug

     目录          0  2012-08-08 09:46  aelesson1\aelesson1\obj\Debug

     目录          0  2012-08-08 09:46  aelesson1\aelesson1\bin

     目录          0  2012-08-08 09:46  aelesson1\aelesson1\obj

     目录          0  2012-08-08 09:46  aelesson1\aelesson1\Properties

     目录          0  2012-08-08 09:46  aelesson1\aelesson1

............此处省略4个文件信息

评论

共有 条评论