I'm trying to write an xml file and attach it to an email. It works great if I give it a path to my personal documents folder(i.e. C:\users\myname\Documents\Test.xml
), but if I try to change it to something like C:\\Test.xml
, I get the following error message:
UnauthorizedAccessException was Unhandled Access to the path 'C:\Test.xml' is denied.
(I can't post pictures apparently)
What would be a good workaround for this?