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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -