IWorkspaceFactory shpFact = new ShapefileWorkspaceFactoryClass();
IWorkspaceName pWorkspaceName = new WorkspaceNameClass();
string Filepath = @"F:\TestData";
IWorkspace pWorkspace = shpFact.OpenFromFile(Filepath, 0);
IEnumDataset pEnumDataset = (IEnumDataset)pWorkspace.get_Datasets(esriDatasetType.esriDTFeatureClass);
IDataset pDataset = (IDataset)pEnumDataset.Next();
while (pDataset != null)
{
MessageBox.Show(pDataset.BrowseName.ToString());
pDataset = (IDataset)pEnumDataset.Next();
}
IWorkspaceName pWorkspaceName = new WorkspaceNameClass();
string Filepath = @"F:\TestData";
IWorkspace pWorkspace = shpFact.OpenFromFile(Filepath, 0);
IEnumDataset pEnumDataset = (IEnumDataset)pWorkspace.get_Datasets(esriDatasetType.esriDTFeatureClass);
IDataset pDataset = (IDataset)pEnumDataset.Next();
while (pDataset != null)
{
MessageBox.Show(pDataset.BrowseName.ToString());
pDataset = (IDataset)pEnumDataset.Next();
}