
c#开发ArcGIS Server代码动态创建发布服务(MapServer,ImageServer)
发布日期:2021-05-10 18:18:05
浏览次数:18
分类:精选文章
本文共 4449 字,大约阅读时间需要 14 分钟。
ArcGIS Server������������MapServer
ArcGIS���������������������������������������������������������������������������������������������������������������������������������������������������MapServer���ImageServer������������������������������������������������MapServer
private bool CreateServices(string MapPath, string ServerName) { ESRI.ArcGIS.ADF.Identity identity = new ESRI.ArcGIS.ADF.Identity(MapServerUserName, MapserverPass, ""); ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection agsConnection = new ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection(HostName, identity); agsConnection.Connect(); IServerObjectAdmin pServerObjectAdmin; pServerObjectAdmin = agsConnection.ServerObjectAdmin; IServerObjectConfiguration2 configuration = (IServerObjectConfiguration2)pServerObjectAdmin.CreateConfiguration(); configuration.Name = ServerName; configuration.TypeName = "MapServer"; IPropertySet props = configuration.Properties; props.SetProperty("FilePath", MapPath); props.SetProperty("OutputDir", "c:\\arcgisserver\\arcgisoutput"); props.SetProperty("VirtualOutPutDir", "http://" + HostName + "/arcgisoutput"); props.SetProperty("SupportedImageReturnTypes", "URL"); props.SetProperty("MaxImageHeight", "2048"); props.SetProperty("MaxRecordCount", "500"); props.SetProperty("MaxBufferCount", "100"); props.SetProperty("MaxImageWidth", "2048"); props.SetProperty("IsCached", "false"); props.SetProperty("CacheOnDemand", "false"); props.SetProperty("IgnoreCache", "false"); props.SetProperty("ClientCachingAllowed", "true"); props.SetProperty("CacheDir", "c:\\arcgisserver\\arcgiscache\\NewService"); props.SetProperty("SOMCacheDir", "c:\\arcgisserver\\arcgiscache"); configuration.IsolationLevel = esriServerIsolationLevel.esriServerIsolationHigh; configuration.IsPooled = true; configuration.MaxInstances = 2; configuration.MinInstances = 1; IPropertySet recycleProp = configuration.RecycleProperties; recycleProp.SetProperty("StartTime", "00:00"); recycleProp.SetProperty("Interval", "3600"); IPropertySet infoProp = configuration.Info; infoProp.SetProperty("WebEnabled", "true"); infoProp.SetProperty("WebCapabilities", "Map,Query,Data"); pServerObjectAdmin.AddConfiguration(configuration); pServerObjectAdmin.StartConfiguration(ServerName, "MapServer"); return true; }
������ImageServer
private bool CreateServices(string ImagePath, string ServerName) { ESRI.ArcGIS.ADF.Identity identity = new ESRI.ArcGIS.ADF.Identity(MapServerUserName, MapserverPass, ""); ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection agsConnection = new ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection(HostName, identity); agsConnection.Connect(); IServerObjectAdmin pServerObjectAdmin; pServerObjectAdmin = agsConnection.ServerObjectAdmin; IServerObjectConfiguration2 configuration = (IServerObjectConfiguration2)pServerObjectAdmin.CreateConfiguration(); configuration.Name = ServerName; configuration.TypeName = "ImageServer"; IPropertySet propertySet = configuration.Properties; propertySet.SetProperty("Path", ImagePath); propertySet.SetProperty("Start", "00:00"); propertySet.SetProperty("Interval", "24"); propertySet.SetProperty("SupportedImageReturnTypes", "URL"); propertySet.SetProperty("OutputDir", "c:\\arcgisserver\\arcgisoutput"); propertySet.SetProperty("VirtualOutPutDir", "http://" + HostName + "/arcgisoutput"); configuration.StartupType = esriStartupType.esriSTAutomatic; configuration.MinInstances = 1; configuration.MaxInstances = 2; configuration.IsPooled = true; IPropertySet infoProp = configuration.Info; infoProp.SetProperty("WebEnabled", "true"); infoProp.SetProperty("WebCapabilities", "Image,Catalog,Metadata,Download,Pixels"); pServerObjectAdmin.AddConfiguration(configuration); pServerObjectAdmin.StartConfiguration(ServerName, "ImageServer"); return true; }
������������ArcGIS Server������������MapServer���ImageServer������������������������������������������������������������������������������ArcGIS���������������������������������������������������������������������������������MapPath���HostName���MapServerUserName���MapserverPass������������������������������������������������������������������������������������
发表评论
最新留言
表示我来过!
[***.240.166.169]2025年04月04日 02时55分46秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
ARFoundation系列讲解-03申请苹果开发者账号
2021-05-10
直接点不玩虚的--启明云端千元现金红包、50pcs开发板直播现场拿走不谢
2021-05-10
木马开发的基本理论基础(五)
2021-05-10
openssl服务器证书操作
2021-05-10
expect 模拟交互 ftp 上传文件到指定目录下
2021-05-10
Matplotlib绘制分组聚合流程图
2021-05-10
Android--消息摘要MD5,SHA加密
2021-05-10
python3 HTTP Error 403:Forbidden
2021-05-10
Java 中的多态详解
2021-05-10
linux系统下双屏显示
2021-05-10
关于高斯模糊核
2021-05-10
PDF.js —— vue项目中使用pdf.js显示pdf文件(流)
2021-05-10
vue解决数据更新,界面未更新的方法
2021-05-10
我用wxPython搭建GUI量化系统之wx.grid实现excel功能
2021-05-10
我用wxPython搭建GUI量化系统之wx.Toolbar实现工具栏
2021-05-10
我用wxPython搭建GUI量化系统之wx.TextCtrl实现文本框
2021-05-10
我用wxPython搭建GUI量化系统之最小架构的运行
2021-05-10
我用wxPython搭建GUI量化系统之Sizer布局管理与页面切换
2021-05-10
我用wxPython搭建GUI量化系统之多只股票走势对比界面
2021-05-10