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
Post a Comment