c# - System.UnauthorizedAccessException occurs under Admin privileges with full access to folder -


i'm out of ideas on fixing "access denied" issue on windows 8.1...

i'm building console app in visual studio under administrative mode , app trying following:

using system.io;  namespace commandcenterscriptlauncher {     class program     {         static void main(string[] args)         {             try             {                 console.writeline("the argument passed " + args[0] + ".");                 console.readline();                 file.writealltext(@"c:\users\matt\music\target", "text file body arg: " + args[0]);             }             catch             {                 console.writeline("no arguments passed.");                 console.readline();                 file.writealltext("c:\\users\\matt\\music\\target", "text file body no args");             }         }     } } 

not running in admin mode isn't helping, folder not read only, , users on security tab target folder have been granted full control.

what else missing here?!

you need pass in filename file.writealltext. right now, looks trying write directory. won't work.


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -