I am getting a access denied exception. How can I fix this?
Here is the exception:
System.UnauthorizedAccessException was unhandled HResult=-214
I'm not sure exactly what all might throw an UnauthorizedAccessException.
One idea though... you're trying to create a file directly in the c: drive, which is sometimes disallowed by system policy. For the sake of troubleshooting, try creating the file somewhere else that you'd have access to, like My Documents.