file - Directory Authorization Issue on visual studio c# -
i create writing test check permission write. test is
try { string filepath = string.format(path.combine(path, path.getrandomfilename())); file.writealltext(filepath, @"0"); file.delete(filepath); return true; } catch (ioexception uex) { //someerrormessage } catch (securityexception uex) { } catch (unauthorizedaccessexception uex) { }
when try write on c:\windows\system32 normal user (i can't write here), file writealltext seems able write in directory if comment delete row, can't see file in directory ( use prompt administrator,too) , if wrote file.readalltext(filepath), can read file. why can create file in c:\windows\system32 , why can see file file.readalltext(filepath)?
Comments
Post a Comment