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 -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -