al eliminar un archivo, obtengo un error

at System.IO.__Error.WinIOError(Int32errorCode, String maybeFullPath) at System.IO.File.Delete(String path)
at secure.course.ContentList.ListCourses.imgBtnExport_Click(Object sender, ImageClickEventArgs e) in secure\course\ContentList\ListCourses.aspx.cs:line 1639

above is the stack trace for the error which i am getting while Deleting a Zip file.

preguntado el 10 de mayo de 11 a las 13:05

Is there an error message at all? -

2 Respuestas

The process cannot access the file 'content\temp\Courses\MSOf­ficeExcel2007MSOE2007.Zip' because it is being used by another process

Well, it sounds like file is in use and cannot be accessed. If you are accessing it in your code, you'll want to close it before you try to delete it. If you aren't accessing it in your code, make sure you don't have another program with it open (IE - you checked the contents of the .zip file in WinZip and didn't close it)

contestado el 21 de mayo de 11 a las 11:05

i didn't think so i just export this file and after that when i saved t his file i am going to create another file on that directory and when i tried to deletee this file this error is coming - Vir

Something else is using the file. That something else may possibly be you if you create the file. Don't assume that nothing has the file in use, because as the error message indicates, that is not the case. Close any other application that ever touches the file, check your application to see if you use the file prior to deleting it, and try again. - Brian M.

Asegúrese de que dispone Full control permission on that folder.

Properties ---> Security

contestado el 10 de mayo de 11 a las 17:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.