逆向删除属性表中的字段
删除属性表中的字段一定要注意循环的方式。如果是for循环,i< FeatureClass.Fields.FieldCount话,每删除一个字段FieldCount属性返回的字段数量将减少一个,也就是你根本不能完全删除想要删除的字段;如果你先把FeatureClass.Fields.FieldCount赋给一个变量count,for循环中使用i 需要注意的是,逆向删除时,起始值是Count – 1,因为字段索引是从0开始的,自然,限制条件i>=0.
删除属性表中的字段一定要注意循环的方式。如果是for循环,i< FeatureClass.Fields.FieldCount话,每删除一个字段FieldCount属性返回的字段数量将减少一个,也就是你根本不能完全删除想要删除的字段;如果你先把FeatureClass.Fields.FieldCount赋给一个变量count,for循环中使用i 需要注意的是,逆向删除时,起始值是Count – 1,因为字段索引是从0开始的,自然,限制条件i>=0.