c# - klocwork Error: No permission set for resource 'streamWriter' before accessing it -


with article,

https://support.roguewave.com/documentation/klocwork/en/10-x/cs.nps/

i still getting klocwork error, after explicitly setting security. solution resolve it.

it's giving error below line of code,

streamwriter.writeline("hello"); 

here full code,

using (var stream = new filestream(@"c:\\sample.txt", filemode.create))         {             var security = new system.security.accesscontrol.filesecurity();             security.addaccessrule(new filesystemaccessrule(@"domain\user", filesystemrights.modify, accesscontroltype.allow));             stream.setaccesscontrol(security);              using (var streamwriter = new streamwriter(stream))             {                 streamwriter.writeline("hello");             }         } 


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -