用IWorkspace2.NameExists可以判断工作空间是否存在指定名称和类型的数据集..
引用MSDN的例子,获得工作空间的文件名字,历遍:
//IWorkspace DatasetNames Example public void IWorkspace_DatasetNames_Example(IWorkspace workspace) { //This function asks the workspace for its feature dataset names. //The names are returned as an enumeration which is cycled through and the //name of each dataset is printed. IEnumDatasetName enumDatasetName = workspace.get_DatasetNames(esriDatasetType.esriDTFeatureDataset); IDatasetName datasetName = enumDatasetName.Next(); while (datasetName != null) { Console.WriteLine(datasetName.Name); datasetName = enumDatasetName.Next(); } }