ArcEngine我要获取当前shp图层的所有字段名,是不是必须先获取图层要素?
1个回答
展开全部
是的,先得到IFeatureLayer
IFeatureLayer featureLayer = m_mapControl.get_Layer(0) as IFeatureLayer;
IFeatureClass featureClass = featureLayer.FeatureClass;
int num = featureClass.Fields.FieldCount;
List<string> lstName = new List<string>();
for (int i = 0; i < num; i++) {
string name = featureClass.Fields.get_Field(i).Name;
lstName.Add(name);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询