I use the statement:
string filePath = Server.MapPath(Session["Sti"] + "/Bilder/" + Session["Bilde"]);
if (System.IO.File.Exists(filePath))
{
System.IO.File.Delete(filePath);
}
to delete files from the server. I use SQL express server .Sometimes it works fine and sometime the application abort and I get the error:
The process cannot access the file <filename>because it is being used by another process.
The error occurs on my local machine and on the server where the imagefile is uploaded.
Can someone please help me. i can not solve the problem
Tom Knardahl
Norway
Go to the complete details ...