Advertisement
Rythorian

Untitled

Nov 24th, 2024
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | Source Code | 0 0
  1. Imports System.IO
  2. Imports System.Security.AccessControl
  3.  
  4. Public Class Form1
  5.  
  6.  
  7. Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  8.  
  9. Dim FilePath As String = "C:\Users\rytho\OneDrive - University of Maine System\Desktop"
  10. Dim UserAccount As String = "Everyone"
  11. Dim FileAcl As New FileSecurity
  12. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''Change to:>> AccessControlType.Deny << to remove priviledges
  13. FileAcl.AddAccessRule(New FileSystemAccessRule(UserAccount, FileSystemRights.Modify, AccessControlType.Allow))
  14. Dim FileInfo As New FileInfo(FilePath)
  15. FileInfo.SetAccessControl(FileAcl)
  16.  
  17. End Sub
  18.  
  19. End Class
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement