释放对象 例如IFeatureCursor,IFeatureClass等
ESRI.ArcGIS.ADF.ComReleaser.ReleaseCOMObject(myFeatureCursor);
打开的Shape文件等把解锁,也就是把.lock文件去掉。
public static void ReleaseFeatureClass(IFeatureClass pFeatureClass)
{
IWorkspace myWorkspace = (pFeatureClass as IDataset).Workspace;
IWorkspaceFactory myWorkspaceFactory = myWorkspace.WorkspaceFactory;
ESRI.ArcGIS.ADF.ComReleaser.ReleaseCOMObject(pFeatureClass);
IWorkspaceFactoryLockControl myWorkspaceFactoryLockControl = myWorkspaceFactory as IWorkspaceFactoryLockControl;
if (myWorkspaceFactoryLockControl.SchemaLockingEnabled)
{
myWorkspaceFactoryLockControl.DisableSchemaLocking();
}
}