F
fyitang
hi guys, here is the sample:
string strFileFullName = "";
try
{
FileInfo currentFile = GetOneFile("some directory");
strFileFullName = currentFile.FullName;
// do someting...
currentFile.Delete();
}
catch(exception ex)
{
savelog(ex);
File.Move(strFileFullName, "some backup folder and file name");
}
these codes are executed by a timer_click event, the timer keep
monitoring some folder, and processing the files one by one. my
question is: why i meet some exception "access to the path '' denied"
occasionally, and why these "exception file" can be moved to my backup
folder? mostly no exception happend. thanks in advance.
string strFileFullName = "";
try
{
FileInfo currentFile = GetOneFile("some directory");
strFileFullName = currentFile.FullName;
// do someting...
currentFile.Delete();
}
catch(exception ex)
{
savelog(ex);
File.Move(strFileFullName, "some backup folder and file name");
}
these codes are executed by a timer_click event, the timer keep
monitoring some folder, and processing the files one by one. my
question is: why i meet some exception "access to the path '' denied"
occasionally, and why these "exception file" can be moved to my backup
folder? mostly no exception happend. thanks in advance.