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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -