An unhandled exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll : Access to the path … is denied

前端 未结 2 1505
时光取名叫无心
时光取名叫无心 2021-01-17 14:19

I am trying to write a file to a directory that exists and is created by me in G:\\\\ i.e. not a system directory or in root drive like this

<
相关标签:
2条回答
  • 2021-01-17 15:07

    This usually means that either there is a folder named "G:\Song", so you can't replace a directory with a file, or that your windows user account doesn't have permission to write to that drive.

    Right-click on the drive and look at security permissions to be sure you have permission. Also, make sure the drive is not readonly, as in the case of a write-protected SD card or flash drive.

    0 讨论(0)
  • 2021-01-17 15:10

    I had a similar issue and stumbled across this thread looking for an answer to another issue I am having.

    But you issue sounds similar to one I had a few weeks ago, and the issue was that SYSTEM needed to also have Full Control over the folder.

    May or may not be the issue, but mentioned incase it solves your or someone else's similar issue to what I experienced.

    0 讨论(0)
提交回复
热议问题