File Directory ASP.Net Tutorial

<%@ Page Language="VB" %>
<%@ Import Namespace="System.IO" %>


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim sec As System.Security.AccessControl.FileSecurity = _
         System.IO.File.GetAccessControl(Server.MapPath("Data.txt"))
        sec.RemoveAccessRule( _
                 New System.Security.AccessControl.FileSystemAccessRule( _
                          "DEMOXP\TestUser", _
                          System.Security.AccessControl.FileSystemRights.FullControl, _
                          System.Security.AccessControl.AccessControlType.Allow _
                          ) _
                 )
        File.SetAccessControl(Server.MapPath("Data.txt"), sec)
    End Sub



    Untitled Page