开发环境:vs2010 + AE 10 测试

public Form1()
{
ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop);
ESRI.ArcGIS.RuntimeManager.BindLicense(ESRI.ArcGIS.ProductCode.Engine);
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
//获得服务对象名称[注意地址和名称;test:发布服务的自定义名称]
IAGSServerObjectName pServerObjectName = GetMapServer("http://172.18.70.254:8081/ArcGIS/services", "test", false);
IName pName = (IName)pServerObjectName;
//访问地图服务
IAGSServerObject pServerObject = (IAGSServerObject)pName.Open();
IMapServer pMapServer = (IMapServer)pServerObject; IMapServerLayer pMapServerLayer = new MapServerLayer() as IMapServerLayer;
//连接地图服务 pMapServerLayer.ServerConnect(pServerObjectName, pMapServer.DefaultMapName);
//添加数据图层 axMapControl1.AddLayer(pMapServerLayer as ILayer); axMapControl1.Refresh();
} public IAGSServerObjectName GetMapServer(string pHostOrUrl, string pServiceName, bool pIsLAN)
{
//设置连接属性
IPropertySet pPropertySet = new PropertySet();
if (pIsLAN)
pPropertySet.SetProperty("machine", pHostOrUrl);
else
pPropertySet.SetProperty("url", pHostOrUrl); //打开连接 IAGSServerConnectionFactory pFactory = new AGSServerConnectionFactory();
//Type factoryType = Type.GetTypeFromProgID(
// "esriGISClient.AGSServerConnectionFactory");
//IAGSServerConnectionFactory agsFactory = (IAGSServerConnectionFactory)
// Activator.CreateInstance(factoryType);
IAGSServerConnection pConnection = pFactory.Open(pPropertySet, ); //Get the image server.
IAGSEnumServerObjectName pServerObjectNames = pConnection.ServerObjectNames;
pServerObjectNames.Reset();
IAGSServerObjectName ServerObjectName = pServerObjectNames.Next();
while (ServerObjectName != null)
{
if ((ServerObjectName.Name.ToLower() == pServiceName.ToLower()) &&
(ServerObjectName.Type == "MapServer"))
{ break;
}
ServerObjectName = pServerObjectNames.Next();
} //返回对象
return ServerObjectName;
}

C#中winform下利用ArcEngine调用ArcGIS Server发布的服务 AE 10的更多相关文章

  1. C#中winform下利用ArcEngine调用ArcGIS Server发布的服务 AE9.3

    主要使用了AE中的IAGSServerOject接口及IMapServer接口.Private void GetServerTest_Click(object sender, EventArgs e) ...

  2. OpenLayers调用arcgis server发布的地图服务

    有两种方式可以调用arcgis server发布的地图服务,一种是rest,一种是wms.  地图的投影为900913,arcgis server为10.0版本,地图服务的空间参考为3857.   与 ...

  3. OpenLayers调用ArcGIS Server发布的WFS服务

    OpenLayers调用ArcGIS Server发布的WFS服务 原创: 蔡建良 2013-08-20 一. 开发环境 1) Openlayers2.13+arcgis server9.3 2) W ...

  4. ArcGis server发布地图服务

    ArcGIS server发布服务: 首先修改地图文档属性中的关联默认数据库 最后使用分享将地图服务发布到server上,是地图服务可以使用: 注意一定要勾选 Feature Access选项 fea ...

  5. Arcgis api for javascript学习笔记 - 不改变默认端口(6080)情况下,外网访问Arcgis Server 发布的接口

    Arcgis Server发布的地图服务地址默认端口号是6080,假设本机上只对80端口做了外网映射,在IIS中部署了一个网站绑定了80端口,那么网站中某个页面通过arcgis api for js ...

  6. ArcGIS API for JavaScript(2)-ArcGIS Server发布要素图层服务

    1.前言 上一篇该系列的文章我们主要讲了一下基础Web地图搭建,这篇我们主要讲一下ArcGIS Server发布服务,并且如何调用服务.将自己的数据加载到Web地图当中来,实现Web端浏览数据. 2. ...

  7. windows 7 下安装 IIS 和 ArcGis Server 9.3 遇到的问题及解决方法

    windows 7 下安装 IIS 和 ArcGis Server 9.3 遇到的问题及解决方法 分类: ArcGIS server 计算机2012-07-31 14:17 631人阅读 评论(0)  ...

  8. arcgis engine 调用arcgis server服务

    首先需要添加两个引用: using ESRI.ArcGIS.GISClient;using ESRI.ArcGIS.DataSourcesRaster; /// <summary> /// ...

  9. WebGIS实现在线要素编辑之ArcGIS Server 发布Feature Service 过程解析

    WebGIS实现在线要素编辑之ArcGIS Server 发布Feature Service 过程解析 FeatureService也称要素服务,其最大的好处就是支持在线要素编辑,并将编辑同步更新到后 ...

随机推荐

  1. 在vue的js文件引入自定义js文件

    自定义js var provinces=[] export default provinces vue页面js引入 import riskLeft from "./index.js" ...

  2. python-ssh-远程服务器+远程docker执行命令

    在python语言中实现远程服务器执行命令+远程dcoker执行命令 def ssh_exec_command(ip, username, password, cmd=None): "&qu ...

  3. Delphi 保留字

  4. 数据结构之查找(图片来源,老师PPT)

    顺序查找进行遍历元素,进行查找 总计全部比较次数为:1+2+…+n = (1+n)n/2 若求某一个元素的平均查找次数,还应当除以n(等概率), 即: ASL=(1+n)/2 ,时间效率为 O(n) ...

  5. hdu 6205 card card card 最大子段和

    #include<iostream> #include<deque> #include<memory.h> #include<stdio.h> #inc ...

  6. 3.4 jmu-java-随机数-使用蒙特卡罗法计算圆周率的值 (10 分)

    import java.util.Scanner; import java.util.Random; public class Main {         public static void ma ...

  7. Java并发编程实战 第8章 线程池的使用

    合理的控制线程池的大小: 下面内容来自网络.不过跟作者说的一致.不想自己敲了.留个记录. 要想合理的配置线程池的大小,首先得分析任务的特性,可以从以下几个角度分析: 任务的性质:CPU密集型任务.IO ...

  8. Java基本的程序结构设计 基本类型的输入输出

    读取输入: java.util.Scanner 一个可以使用正则表达式来分析基本类型和字符串的简单文本扫描器. 了解: Scanner 使用分隔符模式将其输入分解为标记,默认情况下该分隔符模式与空白匹 ...

  9. Canvas + WebSocket + Redis 实现一个视频弹幕

    原文出自:https://www.pandashen.com 页面布局 首先,我们需要实现页面布局,在根目录创建 index.html 布局中我们需要有一个 video 多媒体标签引入我们的本地视频, ...

  10. Spring、SpringMVC注解方式整合

    1 原理 Web容器在启动的时候,会扫描每个jar包下的META-INF/services/javax.servlet.ServletContainerInitializer文件. 加载META-IN ...