一、使用System.Runtime.InteropServices.Marshal.ReleaseComObject(pCursor);释放资源。
二、如果第一不行,可以试用第二种:
IWorkspaceFactory pwf =
new
ShapefileWorkspaceFactory();
//关闭资源锁定
IWorkspaceFactoryLockControl ipWsFactoryLock = (IWorkspaceFactoryLockControl)pwf;
if
(ipWsFactoryLock.SchemaLockingEnabled)
{
ipWsFactoryLock.DisableSchemaLocking();
}
三、参考这个分类锁
关于ArcGIS Engine中Shape文件锁的释放(rd.lock,sr.lock,wr.lock)_Sean的专栏-CSDN博客_arcgis中lock文件怎样解除
参考:一、http://blog.csdn.net/lysc_forever/article/details/7773221
二、https://www.cnblogs.com/liweis/p/4228331.html