第一种,分别设置参数:
//添加命名空间
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Geoprocessor;
//实现button click方法
private void button1_Click(object sender, EventArgs e)
{
//构造Geoprocessor
Geoprocessor gp = new Geoprocessor();
//设置参数
ESRI.ArcGIS.AnalysisTools.Intersect intersect = new ESRI.ArcGIS.AnalysisTools.Intersect();
intersect.in_features = @"F:\foshan\Data\wuqutu_b.shp;F:\foshan\Data\world30.shp";
intersect.out_feature_class = @"E:\intersect.shp";
intersect.join_attributes = "ONLY_FID";
//执行Intersect工具
RunTool(gp, intersect, null);
}
private void RunTool(Geoprocessor geoprocessor, IGPProcess process, ITrackCancel TC)
{
// Set the overwrite output option to true
geoprocessor.OverwriteOutput = true;
try
{