public static void AssignFieldValue(IFeatureClass pFeatureClass, int[] fields, List<object>[] values)
{
ITable pTable = pFeatureClass as ITable;
ICursor pCursor = pTable.Update(null, false);
ESRI.ArcGIS.Geodatabase.IRow pRow = pCursor.NextRow();
int pRowIndex = 0;
while(pRow != null)
{
for(int i = 0; i < fields.Length; i++)
{
pRow.set_Value(fields[i], values[i][pRowIndex]);
}
pRowIndex++;
pCursor.UpdateRow(pRow);
pRow = pCursor.NextRow();
}
System.Runtime.InteropServices.Marshal.ReleaseComObject(pCursor);
}
传入一个待编辑的FeatureClass,需要编辑的字段列表,一个保存值的列表