Geoprocessor gp = new Geoprocessor();
gp.OverwriteOutput = true;
IFeatureLayer inputfeaturelayer = pMap.get_Layer(0) as IFeatureLayer;
IFeatureLayer cliplayer = pMap.get_Layer(1) as IFeatureLayer;
IFeatureClass inputfeatureclass = inputfeaturelayer.FeatureClass;
IFeatureClass clipfeatureclass = cliplayer.FeatureClass;
IDataset dataset = inputfeatureclass as IDataset;
IWorkspace workspace = dataset.Workspace;
IFeatureWorkspace fworkspace = workspace as IFeatureWorkspace;
IFields outfields = inputfeatureclass.Fields;
IFeatureClass outfeatureclass = fworkspace.CreateFeatureClass("Clip_result", outfields, null, null, esriFeatureType.esriFTSimple, "Shape", "");
//如果生成的文件不想输出到硬盘,可以考虑生成内存图层。
ESRI.ArcGI