ArcEngine打开shape文件

OpenFileDialog ofd = new OpenFileDialog();
ofd.Title = "打开shape文件";
ofd.Filter = "shapefile (*.shp)|*.shp";
if (DialogResult.OK==ofd.ShowDialog())
{

//获取shape文件目录
string pPath = Path.GetDirectoryName(ofd.FileName);

//获取shape文件名
string fileName = Path.GetFileName(ofd.FileName);

//添加到axmapcontrol中
axMapControl1.AddShapeFile(pPath,fileName);
}

posted @ 2015-12-23 10:28  Magic_Cc  阅读(969)  评论(0编辑  收藏  举报