• 大小: 1.7MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-24
  • 语言: 其他
  • 标签: Arcgis  engine  10.1  

资源简介

实现了类型ArcCatalog的部分功能 包括sde连接树状列表、新建要素数据集、新建要素类 上传shp文件等

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.esriSystem;
using System.Windows.Forms;

namespace AE_Test
{
    class CDatabaseConn
    {
        /// 
        /// 连接SDE数据库
        /// 

        /// 数据库服务器
        /// 端口号
        /// 用户名
        /// 密码
        /// 
        public static IWorkspace ConnectSDEWorkspace( string hostname string portstring userstring password)
        {
            //连接ArcSDE
            Type factoryType = Type.GetTypeFromProgID(“esriDataSourcesGDB.SdeWorkspaceFactory“);
            IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(factoryType);
            //通过PropertySet设置通过SDE连接数据库的各种参数
            IPropertySet propertySet = new PropertySetClass();
            propertySet.SetProperty(“SERVER“ hostname);
            //propertySet.SetProperty(“INSTANCE“ “port:5151“);
            propertySet.SetProperty(“INSTANCE“ string.Format(“port:{0}“port));
            propertySet.SetProperty(“USER“ user);
            propertySet.SetProperty(“PASSWORD“ password);
            propertySet.SetProperty(“VERSION“ “sde.DEFAULT“);
            //通过以上设置的参数将数据库的数据通过SDE读入工作空间
            try
            {
                IWorkspace workspace = workspaceFactory.Open(propertySet 0);
                return workspace;
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.Message “连接ArcSDE异常“);
                return null;
            }
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-07-02 09:45  AE_Test\
     文件        8944  2015-04-14 16:10  AE_Test\AE_Test.csproj
     文件         855  2015-07-02 09:45  AE_Test\AE_Test.sln
     文件       16896  2015-07-02 09:45  AE_Test\AE_Test.suo
     文件        6656  2015-05-29 17:16  AE_Test\AE_Test.v11.suo
     文件         323  2015-04-14 10:55  AE_Test\App.config
     目录           0  2015-05-27 09:03  AE_Test\bin\
     目录           0  2015-05-27 09:03  AE_Test\bin\Debug\
     文件       73216  2015-04-14 17:11  AE_Test\bin\Debug\AE_Test.exe
     文件         323  2015-04-14 10:55  AE_Test\bin\Debug\AE_Test.exe.config
     文件       91648  2015-04-14 17:11  AE_Test\bin\Debug\AE_Test.pdb
     文件       11608  2015-07-02 09:44  AE_Test\bin\Debug\AE_Test.vshost.exe
     文件         323  2015-04-14 10:55  AE_Test\bin\Debug\AE_Test.vshost.exe.config
     文件         490  2010-03-17 22:39  AE_Test\bin\Debug\AE_Test.vshost.exe.manifest
     文件    10980882  2015-04-14 08:58  AE_Test\bin\Debug\CSPolygon.dbf
     文件       28660  2015-04-14 08:58  AE_Test\bin\Debug\CSPolygon.sbn
     文件        1380  2015-04-14 08:58  AE_Test\bin\Debug\CSPolygon.sbx
     文件     3469468  2015-04-14 08:58  AE_Test\bin\Debug\CSPolygon.shp
     文件       40690  2015-04-14 08:58  AE_Test\bin\Debug\CSPolygon.shp.xml
     文件       23660  2015-04-14 08:58  AE_Test\bin\Debug\CSPolygon.shx
     目录           0  2015-05-27 09:03  AE_Test\bin\Debug\sr\
     文件         153  2014-12-14 19:39  AE_Test\bin\Debug\sr\Krasovsky 1940.prj
     文件         145  2014-12-14 19:39  AE_Test\bin\Debug\sr\PathSolveRecord.prj
     目录           0  2015-05-27 09:03  AE_Test\bin\Debug\sr\地理坐标系\
     文件         176  2014-12-14 19:39  AE_Test\bin\Debug\sr\地理坐标系\Beijing 1954.prj
     文件         170  2014-12-14 19:39  AE_Test\bin\Debug\sr\地理坐标系\WGS 1984.prj
     文件         167  2014-12-14 19:39  AE_Test\bin\Debug\sr\地理坐标系\Xian 1980.prj
     目录           0  2015-05-27 09:03  AE_Test\bin\Debug\sr\投影坐标系\
     目录           0  2015-05-27 09:03  AE_Test\bin\Debug\sr\投影坐标系\Beijing 1954\
     文件         434  2014-12-14 19:39  AE_Test\bin\Debug\sr\投影坐标系\Beijing 1954\Beijing 1954 3 Degree GK CM 102E.prj
     文件         434  2014-12-14 19:39  AE_Test\bin\Debug\sr\投影坐标系\Beijing 1954\Beijing 1954 3 Degree GK CM 105E.prj
............此处省略206个文件信息

评论

共有 条评论