判断Workspace的存在

IWorkspaceFactory.ContainsWorkspace
另外,附上帮助的例子:

        public Boolean IWorkspaceFactory_ContainsWorkspace_Example(string nameOfFile)
        {
            //use with AccessWorkspaceFactory          
            IWorkspaceFactory workspaceFactory = new ESRI.ArcGIS.DataSourcesGDB.AccessWorkspaceFactoryClass();
            //for FileGDB use ESRI.ArcGIS.DataSourcesGDB.FileGDBWorkspaceFactoryClass();          
            ESRI.ArcGIS.esriSystem.IFileNames fileNames = new ESRI.ArcGIS.esriSystem.FileNamesClass();
            fileNames.Add(nameOfFile);
            return workspaceFactory.ContainsWorkspace("E:\\data\\english\\canada\\", fileNames);
        }

 

 

posted @ 2010-03-21 21:02  `X.x|嚨  阅读(314)  评论(0编辑  收藏  举报