Can't create a file in C:\inetpub\wwwroot programmatically
问题 I have a function in the code behind of an ASP.NET webpage that creates a file and then opens it with a javascript command. This works in the IDE - it creates the file, asks me where I want to save the file, I can save it, etc. - but when I install the website and test it out, I get an UnauthorizedAccessException while just trying to create the directory for the file within C:\inetpub\wwwroot. The frustrating part is that I have a similar function that runs in a service and that creates its