如何删除此文件 [英] How To Delete This File
本文介绍了如何删除此文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
AccessDB.Create("Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + FileN + "; Jet OLEDB:Engine Type=5");
创建上述文件后我尝试删除此文件
它给我一个错误文件使用其他过程
如果(File.Exists(FileN)
{
File.Delete(FileN);
}
怎么做...?
谢谢
After Create Above File I Try To Delete This File
It Gives me an error file use by other process
if (File.Exists(FileN)
{
File.Delete(FileN);
}
How to Do This ..?
Thank You
推荐答案
无法删除当前的文件在你可以删除之前,你必须关闭该文件首先打开的任何程序。
同时检查Bellow链接
http ://dotnet-assembly.blogspot.in/2012/10/c-check-file-is-being-used-by-another.html [ ^ ]
There is no way to delete a file that's currently in use by another process. You have to close whatever program has that file open first, before you can delete it.
Also check for Bellow link
http://dotnet-assembly.blogspot.in/2012/10/c-check-file-is-being-used-by-another.html[^]
这篇关于如何删除此文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文