antivirus - how to block a access to any file or exe vb.net? -


i wondering if new how block , unblock file or executable being opened permanently , unblock file using code in vb.net in advance.

you can use code, , can use environment.username name of user, , lock type of file , lock folder :

dim fss filesystemsecurity = file.getaccesscontrol(application.startuppath & "\quarantine\" & newtextdoc.text) fss.addaccessrule(new filesystemaccessrule(environment.username, filesystemrights.fullcontrol, accesscontroltype.deny)) file.setaccesscontrol(application.startuppath & "\quarantine\" & newtextdoc.text, fss) 

and unlock file/folder remove accessrule :

dim fss filesystemsecurity = file.getaccesscontrol(application.startuppath & "\quarantine\" & newtextdoc.text) fss.removeaccessrule(new filesystemaccessrule(environment.username, filesystemrights.fullcontrol, accesscontroltype.deny)) file.setaccesscontrol(application.startuppath & "\quarantine\" & newtextdoc.text, fss) 

finally hope :)


Comments

Popular posts from this blog

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -