What is Access Control Lists? How to add a rule to the Access Control List?

 Posted by Tripati_tutu on 10/28/2010 | Category: ASP.NET Interview questions | Views: 2411 | Points: 40

These are the way resources such as directories and files are secured in the NTFS file system which is commonly used file system in all windows. You can also view this file by selecting the security tab from the file’s properties dialog. To get this security tab follow the steps that is mentioned below...
Step-1: Create a text file.
Step-2: Right click on that file and click on properties.
Now you will get that security tab.

Code snippet to add a rule to the Access Control Li st:

System.Security.AccessControl.FileSecurity sec = 

System.IO.File.GetAccessControl (Server.MapPath(“Test.txt”));

sec.AddAccessRule (new System.Security.AccessControl.FileSystemAccessRule (

System.IO.File.SetAccessControl (Server.MapPath (“Test.txt”), sec);

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response