打开FileGeoDatabase中要素类
private IFeatureClass OpenFileGdbFtCls(string fn) { IFeatureClass pftcls = null; IWorkspaceFactory wsfactory = new FileGDBWorkspaceFactoryClass(); IWorkspace ws = wsfactory.OpenFromFile(System.IO.Path.GetDirectoryName(fn),0); IFeatureWorkspace fws = ws as IFeatureWorkspace; pftcls = fws.OpenFeatureClass(System.IO.Path.GetFileNameWithoutExtension(fn)); return pftcls; }
代码如上