How to create a directory in C directory of Windows7 in C#.Net -


i writing exception log (eg. log.txt) , want write in following path "c:\program files (x86)\app\log". when so, whole path access denied means cannot create folder called log , simultaneously write log.txt , have compression code zip log files log.zip days based? did try of code snippets stack overflow apparently nothing fruitful.

how resolve problem??

regards, gibson

the error getting due fact regular user doesn't have permission create folders or files beneath "c:\program files (x86)\" directory. this on purpose because regular user should not writing directory.

applications installed beneath directory administrative user, or user elevated permissions. application should writing log files location beneath user's profile directory, e.g. somewhere beneath "%appdata%".

i work in department have support poorly-written vendor software needs update files somewhere beneath %programfiles% directory, , it's total nightmare. don't want our users have permission in general write folder because potentially allow malicious software -- viruses, etc. -- surreptitiously modify our applications. however, have make exceptions in our virus software , maintain special security on folders deviant application that, unfortunately, our business relies on. point of story is: don't it. it's bad practice, , customers not happy.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -