1个回答
2013-08-20
展开全部
public void DeleteFeatureClass(string featueClassName)
{
IWorkspaceFactory worFact =new FileGDBWorkspaceFactory();
IWorkspace workspace = worFact.OpenFromFile("路径", 0);
IFeatureWorkspace featureWorkspace = workspace as IFeatureWorkspace;
IFeatureWorkspaceManage featureWorkspaceMange = (IFeatureWorkspaceManage)featureWorkspace;
IEnumDatasetName enumDatasetName = workspace.get_DatasetNames(esriDatasetType.esriDTFeatureClass);
IDatasetName datasetName = null;
while ((datasetName = enumDatasetName.Next()) != null)
{
if (datasetName.Name.Equals(featueClassName))
{
featureWorkspaceMange.DeleteByName(datasetName);//删除指定要素类
break;
}
}
}
{
IWorkspaceFactory worFact =new FileGDBWorkspaceFactory();
IWorkspace workspace = worFact.OpenFromFile("路径", 0);
IFeatureWorkspace featureWorkspace = workspace as IFeatureWorkspace;
IFeatureWorkspaceManage featureWorkspaceMange = (IFeatureWorkspaceManage)featureWorkspace;
IEnumDatasetName enumDatasetName = workspace.get_DatasetNames(esriDatasetType.esriDTFeatureClass);
IDatasetName datasetName = null;
while ((datasetName = enumDatasetName.Next()) != null)
{
if (datasetName.Name.Equals(featueClassName))
{
featureWorkspaceMange.DeleteByName(datasetName);//删除指定要素类
break;
}
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询