『公告』 预祝您龙年大吉,万事如意, 过节期间, 大家如需数据服务,请拨打400 或直接添加客服微信,再祝大家龙年,心想事成。
关注我们 新浪 腾讯

ArcGIS Engine 10 开发手册(3-3)添加Shape文件

ArcGIS Engine 10 开发手册(3-3)添加Shape文件
AxMapControl 还包含下面三个方法用来添加不同类型的数据,这些方法如下:

     AxMapControl 还包含下面三个方法用来添加不同类型的数据,这些方法如下:

 

 

 

     为打开 shp 文件要两个参数,所以构造一个数 组,用来返回相应的参数,代码如下:

 

public string[] OpenShapeFile ()

{

  string[] ShpFile = new string[2];

  OpenFileDialog OpenShpFile = new OpenFileDialog ();

  OpenShpFile.Title = "打开Shape文件";

  OpenShpFile.InitialDirectory = "E:";

  OpenShpFile.Filter = "Shape文件(*.shp)|*.shp";

 

  if (OpenShpFile.ShowDialog () == DialogResult.OK)

  {

    string ShapPath = OpenShpFile.FileName;

    //利用"\\"将文件路径分成两部分

    int Position = ShapPath.LastIndexOf ("\\");

 

    string FilePath = ShapPath.Substring (0, Position);

    string ShpName = ShapPath.Substring (Position + 1);

    ShpFile[0] = FilePath;

 

    ShpFile[1] = ShpName;

 

  }

  return ShpFile;

}

      京ICP备08100627号-22 京公网安备 11010802030428号