本文介绍了arcgis Map c#进程无法访问文件C:\ Users ..,因为该文件正在由另一个进程使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在arcgis c#中有问题.我正在使用Arcgis axMapControl组件并向其中添加图像,但是当我想从axMapControl组件中删除图像时我无法删除图像...我遇到了一个异常,例如该进程无法访问文件C:\ Users ..,因为它是被另一个进程使用我需要您的帮助:),非常感谢您的帮助:)
示例代码
I have a problem in arcgis c#. I am using Arcgis axMapControl component and adding image to it but I can not delete image when wanted to delete from axMapControl component... I have get a exception such as " The process cannot access the file C:\Users.. because it is being used by another process " I need your help :) and verryyy thankss for your helps :)
example code
public void Add_map()
{
IRasterLayer my_raster = new RasterLayer();
my_raster.FromFile(path);
AxMapControl1.AddLayer(my_raster);
}
--------------------------------------------------
public void Delete_map()
{
AxMapControl1.DeleteLayer(0);
System.IO.File.delete(path); //There is a Exception.... This problem...
}
推荐答案
System.IO.File.delete(path);
这篇关于arcgis Map c#进程无法访问文件C:\ Users ..,因为该文件正在由另一个进程使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!