简体   繁体   中英

How to solve system.unauthorizedaccessexception access to the path is denied

I am creating a file from base64 string and while creating file i am getting system.unauthorizedaccessexception if base64 string is image type and it was working fine in remaining file types

File.WriteAllBytes(imagepath, Convert.FromBase64String(yourBase64String));

can any one help me?

Thanks in advance

The executable doesn't have access to that file. Run the exe as administrator, or make sure you give it a location that it has access to.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM