Why is access to the path denied?

前端 未结 29 1064
刺人心
刺人心 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 15:54

    First just check the path if the colon(:) character is missing or not after the drive letter. If colon is not missing then you can check if access/write permission is granted for that path. I had the same issue and i was only missing the colon, permission and everything else was fine.

    C:\folderpath
    

    will work fine but,

    C\folderpath .........(missing colon)
    

    will give you access denial error.

提交回复
热议问题