摘要:
现在需要对已有的要素图层添加字段,尝试以下代码:IFeatureClass pFc= ((IFeatureLayer)lyrRec).FeatureClass; IFieldsEdit fldsE = pFc.Fields as IFieldsEdit;IField fld = new FieldClass();IFieldEdit2 fldE = fld as IFieldEdit2;fldE.Type_2 = esriFieldType.esriFieldTypeString;fldE.Name_2 = "XXX";ic.AddField(fld);int idTest 阅读全文