简体   繁体   中英

file/folder is already in use, renaming,deletion problem ? c# iis

I am trying to renme a file/folder, when i try to rename a file, i got an error, file is already in use, it is just my guess that it is caused by w3wp.exe iis process? some time its says, access to the path is denied, although the file does exist, and there are no special permission, i have all the permission to copy/delete/move and everything for the file/folder. How to fix this problem.

the folder contains jpeg files. this happen: when i copy a file then try to rename it. this happen: when i rename a file then try to delete it. what i mean to say is that it happen when i already use a file operation then for second time it gives me this error :( this is the error: The process cannot access the file 'C:\\images\\audio-aif-old.png' because it is being used by another process.

file.move(source,destination);

i am using C#. iis 6, asp.net.

Directly , ans is no. But you can delete old copy and create a new copy. See this. http://www.aspnettutorials.com/tutorials/file/file-renfile-aspnet2-csharp.aspx

Some other program must relinquish the file. If you've written a program that's still running then that must be shut down. If the file is currently open for writing you must also ensure that it's been appropriately closed. Try creating another file and see if you have the same problem with that one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM