zoukankan      html  css  js  c++  java
  • 常用方法

    一,获取Mxd地图文档的路径
    /// <summary>
            /// 获取Mxd地图文档的路径
            /// </summary>
            /// <param name="MapControl"></param>
            private string OpenMxFile()
            {
                string mxdFile = "" ;
     
                OpenFileDialog ofd = new OpenFileDialog();
                ofd.InitialDirectory = @"D:Program Files (x86)ArcGISDeveloperKit10.2Samplesdata";
                ofd.Filter = "Map Documents(*.Mxd)|*.mxd";
     
                if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    mxdFile = ofd.FileName;
     
                }
     
                return mxdFile;
            }


    二,获取ShapeFile的路径
    /// <summary>
            /// 获取ShapeFile的路径
            /// </summary>
            /// <returns></returns>
            private string[] OpenShapeFile()
            { 
              string[] ShpFile = new string[2];
              OpenFileDialog ofd = new OpenFileDialog();
              ofd.Title = "打开shp文件";
              ofd.InitialDirectory = @"D:Program Files (x86)ArcGISDeveloperKit10.2Samplesdata";
              ofd.Filter = "Shp文件(*.shp)|*.shp";
     
              if (ofd.ShowDialog()== System.Windows.Forms.DialogResult.OK)
              {
                  string ShapePath = ofd.FileName;
                  
                  //利用"\"将文件路径分成两部分
                  int position = ShapePath.LastIndexOf("\");
                  string filePath = ShapePath.Substring(0,position);
                  string fileName = ShapePath.Substring(position+1);
                  ShpFile[0] = filePath;
                  ShpFile[1] = fileName;
     
              }
     
              return ShpFile;
            }


  • 相关阅读:
    Django 支付宝付款接口的使用
    Django 处理跨域的配置、前台处理ajax
    pip安装源
    Django 缓存机制
    Django 配置使用日志
    Celery框架的基本使用方法
    python 虚拟环境的搭建
    Django 后台管理xadmin
    Python学习之路_day_16(模块搜索路径,开发规范)
    Python学习之路_day_15(模块)
  • 原文地址:https://www.cnblogs.com/Robert-huge/p/5855564.html
Copyright © 2011-2022 走看看