ArcGis中arcgis server连接文件生成

环境:win10+geany+python2.7

import arcpy  # ——根据ArcGis版本引用ArcGis10.2的python版本为2.7

out_folder_path = ‘C:\Project’  #——路径任意设置(避免python识别的 \t  \n等字符)

out_name = ‘server.ags’    #——生成的文件名称及类型(文件名避免组成python识别的 \t  \n等字符)

server_url = ‘http://172.20.10.2:6080/arcgis/admin’   #——可在ArcGis中查看。
   
arcpy.mapping.CreateGISServerConnectionFile(“USE_GIS_SERVICES”,
                                            out_folder_path,
                                            out_name,
                                            server_url,
                                            “ARCGIS_SERVER”,
                                            username=’siteadmin’,
                                            password=’831143′,

                                            save_username_password=True)

参考ArcGisHelp-10.2

http://resources.arcgis.com/zh-cn/help/main/10.2/#/na/00s300000079000000/%20%E2%80%9CArcGIS%20Server%E8%BF%9E%E6%8E%A5%E6%96%87%E4%BB%B6%E7%94%9F%E6%88%90%E2%80%9D

转载自:https://blog.csdn.net/u012248603/article/details/79268190

You may also like...