Why is access to the path denied?

前端 未结 29 1615
刺人心
刺人心 2020-11-22 15:25

I am having a problem where I am trying to delete my file but I get an exception.

if (result == \"Success\")
{
     if (FileUpload.HasFile)
     {
         t         


        
29条回答
  •  再見小時候
    2020-11-22 16:02

    According to File.Delete Method...

    An UnauthorizedAccessException means one of 4 things:

    • The caller does not have the required permission.
    • The file is an executable file that is in use.
    • Path is a directory.
    • Path specified a read-only file.

提交回复
热议问题